Commit 8b2ceb6b authored by Dave Martin's avatar Dave Martin Committed by Ben Hutchings

ARM: 8643/3: arm/ptrace: Preserve previous registers for short regset write

commit 228dbbfb upstream.

Ensure that if userspace supplies insufficient data to
PTRACE_SETREGSET to fill all the registers, the thread's old
registers are preserved.

Fixes: 5be6f62b ("ARM: 6883/1: ptrace: Migrate to regsets framework")
Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent d57d09e7
...@@ -600,7 +600,7 @@ static int gpr_set(struct task_struct *target, ...@@ -600,7 +600,7 @@ static int gpr_set(struct task_struct *target,
const void *kbuf, const void __user *ubuf) const void *kbuf, const void __user *ubuf)
{ {
int ret; int ret;
struct pt_regs newregs; struct pt_regs newregs = *task_pt_regs(target);
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&newregs, &newregs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment