VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   35 Branches   59 Tags
author: Alexey Dobriyan <adobriyan@openvz.org> 2007-01-26 00:57:16 -0800 committer: Linus Torvalds <torvalds@woody.linux-foundation.org> 2007-01-26 13:51:00 -0800 commit: 1fb844961818ce94e782acf6a96b92dc2303553b parent: c20086de9319ac406f1e96ad459763c9f9965b18
Commit Summary:
[PATCH] core-dumping unreadable binaries via PT_INTERP
Diffstat:
1 file changed, 8 insertions, 0 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 6e6d4568d548..a4d933a51208 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -234,6 +234,14 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm,
 				goto error;
 			}
 
+			/*
+			 * If the binary is not readable then enforce
+			 * mm->dumpable = 0 regardless of the interpreter's
+			 * permissions.
+			 */
+			if (file_permission(interpreter, MAY_READ) < 0)
+				bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP;
+
 			retval = kernel_read(interpreter, 0, bprm->buf,
 					     BINPRM_BUF_SIZE);
 			if (retval < 0)