From: Suresh Siddha Date: Sun, 26 Feb 2006 03:18:28 +0000 (+0100) Subject: [PATCH] x86_64: Check for bad elf entry address. X-Git-Tag: v2.6.16-rc5~14 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5342fba5412cead88b61ead07168615dbeba1ee3;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 1b117a44129..c2eac2a50bd 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) kfree(elf_interpreter); } else { elf_entry = loc->elf_ex.e_entry; + if (BAD_ADDR(elf_entry)) { + send_sig(SIGSEGV, current, 0); + retval = -ENOEXEC; /* Nobody gets to see this, but.. */ + goto out_free_dentry; + } } kfree(elf_phdata);