Commit 39b56d90 authored by Pavel Machek's avatar Pavel Machek Committed by Linus Torvalds

[PATCH] binfmt_elf: clearing bss may fail

So we discover that Borland's Kylix application builder emits weird elf
files which describe a non-writeable bss segment.

So remove the clear_user() check at the place where we zero out the bss.  I
don't _think_ there are any security implications here (plus we've never
checked that clear_user() return value, so whoops if it is a problem).
Signed-off-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 224789f6
......@@ -803,11 +803,13 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
nbyte = ELF_MIN_ALIGN - nbyte;
if (nbyte > elf_brk - elf_bss)
nbyte = elf_brk - elf_bss;
if (clear_user((void __user *) elf_bss + load_bias, nbyte)) {
retval = -EFAULT;
send_sig(SIGKILL, current, 0);
goto out_free_dentry;
}
/*
* This bss-zeroing can fail if the ELF file
* specifies odd protections. So we don't check
* the return value
*/
(void)clear_user((void __user *)elf_bss +
load_bias, nbyte);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment