Skip to content

Commit

Permalink
tile/ptrace: Preserve previous registers for short regset write
Browse files Browse the repository at this point in the history
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
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
  • Loading branch information
Dave Martin authored and Chris Metcalf committed Jan 6, 2017
1 parent 0c744ea commit fd7c991
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/tile/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static int tile_gpr_set(struct task_struct *target,
const void *kbuf, const void __user *ubuf)
{
int ret;
struct pt_regs regs;
struct pt_regs regs = *task_pt_regs(target);

ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &regs, 0,
sizeof(regs));
Expand Down

0 comments on commit fd7c991

Please sign in to comment.