summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2017-03-27 15:10:55 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2017-03-29 08:54:17 -0700
commita78ce80d2c9178351b34d78fec805140c29c193e (patch)
tree8eaa65759d128a6fb2ff25847fa1ff3170a7938e /arch
parent502585c7555083d4a949c08350306b9ec196779e (diff)
downloadlinux-0-day-a78ce80d2c9178351b34d78fec805140c29c193e.tar.gz
linux-0-day-a78ce80d2c9178351b34d78fec805140c29c193e.tar.xz
metag/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: James Hogan <james.hogan@imgtec.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/metag/kernel/ptrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/metag/kernel/ptrace.c b/arch/metag/kernel/ptrace.c
index 7563628822bdf..ae659ba619487 100644
--- a/arch/metag/kernel/ptrace.c
+++ b/arch/metag/kernel/ptrace.c
@@ -303,7 +303,7 @@ static int metag_tls_set(struct task_struct *target,
const void *kbuf, const void __user *ubuf)
{
int ret;
- void __user *tls;
+ void __user *tls = target->thread.tls_ptr;
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
if (ret)