summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2017-01-18 17:11:56 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2017-01-30 12:04:12 +0000
commit228dbbfb5d77f8e047b2a1d78da14b7158433027 (patch)
tree755364110d50fc4deb8bbf4a5a228faac3122460 /arch/arm/kernel
parent97a98ae5b8acf08d07d972c087b2def060bc9b73 (diff)
downloadlinux-stable-228dbbfb5d77f8e047b2a1d78da14b7158433027.tar.gz
linux-stable-228dbbfb5d77f8e047b2a1d78da14b7158433027.tar.bz2
linux-stable-228dbbfb5d77f8e047b2a1d78da14b7158433027.zip
ARM: 8643/3: arm/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> # 3.0.x- Fixes: 5be6f62b0059 ("ARM: 6883/1: ptrace: Migrate to regsets framework") Signed-off-by: Dave Martin <Dave.Martin@arm.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/ptrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index ce131ed5939d..ae738a6319f6 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -600,7 +600,7 @@ static int gpr_set(struct task_struct *target,
const void *kbuf, const void __user *ubuf)
{
int ret;
- struct pt_regs newregs;
+ struct pt_regs newregs = *task_pt_regs(target);
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&newregs,