提交 e95d3bf0 编写于 作者: M Mike McCormack 提交者: Riku Voipio

Fix buffer overrun in sched_getaffinity

Zeroing of the cpu array should start from &cpus[kernel_ret]
not &cpus[num_zeros_to_fill].

This fixes a crash in EFL's edje_cc running under qemu-arm.
Signed-off-by: NMike McCormack <mj.mccormack@samsung.com>
Reviewed-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: NMike Frysinger <vapier@gentoo.org>
Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
上级 6f11f013
......@@ -6505,7 +6505,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
unsigned long zero = arg2 - ret;
p = alloca(zero);
memset(p, 0, zero);
if (copy_to_user(arg3 + zero, p, zero)) {
if (copy_to_user(arg3 + ret, p, zero)) {
goto efault;
}
arg2 = ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册