Fix buffer overrun in sched_getaffinity
PATCH 1/2 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 Mike McCormack <[email protected]>
Reviewed-by Stefan Hajnoczi <[email protected]>
Acked-by Mike Frysinger <[email protected]>
--- linux-user/syscall.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall.c +1 -1
@@ -6389,7 +6389,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;
Signature · 1 line
1.7.0.4