Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64/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.

Cc: <stable@vger.kernel.org> # 4.3.x-
Fixes: 5d220ff9420f ("arm64: Better native ptrace support for compat tasks")
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Will Deacon <Will.Deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Dave Martin and committed by
Catalin Marinas
a672401c 9dd73f72

+1 -1
+1 -1
arch/arm64/kernel/ptrace.c
··· 950 950 const void __user *ubuf) 951 951 { 952 952 int ret; 953 - compat_ulong_t tls; 953 + compat_ulong_t tls = target->thread.tp_value; 954 954 955 955 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1); 956 956 if (ret)