From: Dave Martin Date: Mon, 27 Mar 2017 14:10:59 +0000 (+0100) Subject: sparc/ptrace: Preserve previous registers for short regset write X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d3805c546b275c8cc7d40f759d029ae92c7175f2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git sparc/ptrace: Preserve previous registers for short regset write Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET to fill all the registers, the thread's old registers are preserved. Signed-off-by: Dave Martin Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 901063c1cf7e..341129a40e94 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c @@ -350,7 +350,7 @@ static int genregs64_set(struct task_struct *target, } if (!ret) { - unsigned long y; + unsigned long y = regs->y; ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &y,