summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2017-03-27 15:10:59 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2017-03-29 08:54:17 -0700
commitd3805c546b275c8cc7d40f759d029ae92c7175f2 (patch)
tree5079b224816aa16b627eaf853da9403ad4747da8 /arch/sparc
parentd614fd58a2834cfe4efa472c33c8f3ce2338b09b (diff)
downloadlinux-stable-d3805c546b275c8cc7d40f759d029ae92c7175f2.tar.gz
linux-stable-d3805c546b275c8cc7d40f759d029ae92c7175f2.tar.bz2
linux-stable-d3805c546b275c8cc7d40f759d029ae92c7175f2.zip
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 <Dave.Martin@arm.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/ptrace_64.c2
1 files changed, 1 insertions, 1 deletions
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,