From: Pavel Machek 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: Pavel Machek Signed-off-by: Andrew Morton --- 25-akpm/fs/binfmt_elf.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff -puN fs/binfmt_elf.c~binfmt_elf-clearing-bss-may-fail fs/binfmt_elf.c --- 25/fs/binfmt_elf.c~binfmt_elf-clearing-bss-may-fail 2005-02-09 17:07:18.000000000 -0800 +++ 25-akpm/fs/binfmt_elf.c 2005-02-09 17:28:15.000000000 -0800 @@ -803,11 +803,13 @@ static int load_elf_binary(struct linux_ 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); } } _