Commit 467aa146 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Greg Ungerer

binfmt_flat: use clear_user() rather than memset() to clear .bss

This is needed on systems with a MMU.
Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
Reviewed-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
Signed-off-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
parent 1b2ce442
......@@ -795,10 +795,11 @@ static int load_flat_file(struct linux_binprm *bprm,
flush_icache_range(start_code, end_code);
/* zero the BSS, BRK and stack areas */
memset((void *)(datapos + data_len), 0, bss_len +
(memp + memp_size - stack_len - /* end brk */
libinfo->lib_list[id].start_brk) + /* start brk */
stack_len);
if (clear_user((void __user *)(datapos + data_len), bss_len +
(memp + memp_size - stack_len - /* end brk */
libinfo->lib_list[id].start_brk) + /* start brk */
stack_len))
return -EFAULT;
return 0;
err:
......
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