patch-2.4.13 linux/fs/binfmt_elf.c
Next file: linux/fs/binfmt_misc.c
Previous file: linux/fs/attr.c
Back to the patch index
Back to the overall index
-  Lines: 19
-  Date:
Sat Oct 20 19:16:59 2001
-  Orig file: 
v2.4.12/linux/fs/binfmt_elf.c
-  Orig date: 
Tue Oct  9 17:06:53 2001
diff -u --recursive --new-file v2.4.12/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
@@ -270,6 +270,8 @@
 	 */
 	if (interp_elf_ex->e_phentsize != sizeof(struct elf_phdr))
 		goto out;
+	if (interp_elf_ex->e_phnum > 65536U / sizeof(struct elf_phdr))
+		goto out;
 
 	/* Now read in all of the header information */
 
@@ -757,8 +759,7 @@
 	printk("(brk) %lx\n" , (long) current->mm->brk);
 #endif
 
-	if ( current->personality == PER_SVR4 )
-	{
+	if (current->personality & MMAP_PAGE_ZERO) {
 		/* Why this, you ask???  Well SVr4 maps page 0 as read-only,
 		   and some applications "depend" upon this behavior.
 		   Since we do not have the power to recompile these, we
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)