Skip to content

Commit 2d9bc36

Browse files
Dave Martingregkh
authored andcommitted
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>
1 parent 962b95a commit 2d9bc36

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/metag/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int metag_tls_set(struct task_struct *target,
303303
const void *kbuf, const void __user *ubuf)
304304
{
305305
int ret;
306-
void __user *tls;
306+
void __user *tls = target->thread.tls_ptr;
307307

308308
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
309309
if (ret)

0 commit comments

Comments
 (0)