Skip to content

Commit

Permalink
ARM: 8643/3: arm/ptrace: Preserve previous registers for short regset…
Browse files Browse the repository at this point in the history
… 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: 5be6f62 ("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>
  • Loading branch information
Dave Martin authored and Russell King committed Jan 30, 2017
1 parent 97a98ae commit 228dbbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 228dbbf

Please sign in to comment.