Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2739b487 authored by Dave Martin's avatar Dave Martin Committed by Greg Kroah-Hartman
Browse files

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: default avatarDave Martin <Dave.Martin@arm.com>
Acked-by: default avatarJames Hogan <james.hogan@imgtec.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 84b94c43
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)