| Kernel v2.4.33 /fs/binfmt_elf.c |
|---|
 2.4.33
 fs
 binfmt_elf.c
diff -urN linux-2.4.32/fs/binfmt_elf.c linux-2.4.33/fs/binfmt_elf.c
--- linux-2.4.32/fs/binfmt_elf.c 2005-06-01 00:56:56.000000000 +0000
+++ linux-2.4.33/fs/binfmt_elf.c 2006-08-11 04:18:20.963196198 +0000
@@ -643,6 +643,11 @@
SET_PERSONALITY(elf_ex, ibcs2_interpreter);
}
+ if (BAD_ADDR(elf_ex.e_entry)) {
+ retval = -ENOEXEC;
+ goto out_free_dentry;
+ }
+
/* OK, we are done with that, now set up the arg stuff,
and then start this sucker up */
@@ -820,7 +825,7 @@
printk(KERN_ERR "Unable to load interpreter %.128s\n",
elf_interpreter);
force_sig(SIGSEGV, current);
- retval = -ENOEXEC; /* Nobody gets to see this, but.. */
+ retval = IS_ERR((void *)elf_entry) ? PTR_ERR((void *)elf_entry) : -ENOEXEC;
goto out_free_dentry;
}
reloc_func_desc = interp_load_addr;
|