diff options
author | Dave Martin <Dave.Martin@arm.com> | 2017-03-27 15:10:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-31 10:33:42 +0200 |
commit | 3e0a29e1b6c60cfaf607d06d572bf6327f4e5f94 (patch) | |
tree | bee1d6828c577d479570affbd5ea492d822f4e79 | |
parent | fc1ff8342c6623c76e1c7f9e419764365e321df2 (diff) |
metag/ptrace: Preserve previous registers for short regset write
commit a78ce80d2c9178351b34d78fec805140c29c193e upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/metag/kernel/ptrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/metag/kernel/ptrace.c b/arch/metag/kernel/ptrace.c index 7563628822bd..ae659ba61948 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) |