aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2006-02-25 22:18:28 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-26 12:53:30 -0500
commit5342fba5412cead88b61ead07168615dbeba1ee3 (patch)
tree1ec0936cff22284b2226f431033b1a36b27615c7 /fs
parentf83f2b5fbab4585f4de4523c7879d60e3f85a248 (diff)
[PATCH] x86_64: Check for bad elf entry address.
Fixes a local DOS on Intel systems that lead to an endless recursive fault. AMD machines don't seem to be affected. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_elf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 1b117a441298..c2eac2a50bd2 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -938,6 +938,11 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
938 kfree(elf_interpreter); 938 kfree(elf_interpreter);
939 } else { 939 } else {
940 elf_entry = loc->elf_ex.e_entry; 940 elf_entry = loc->elf_ex.e_entry;
941 if (BAD_ADDR(elf_entry)) {
942 send_sig(SIGSEGV, current, 0);
943 retval = -ENOEXEC; /* Nobody gets to see this, but.. */
944 goto out_free_dentry;
945 }
941 } 946 }
942 947
943 kfree(elf_phdata); 948 kfree(elf_phdata);