Skip to content

Commit

Permalink
metag/ptrace: Reject partial NT_METAG_RPIPE writes
Browse files Browse the repository at this point in the history
It's not clear what behaviour is sensible when doing partial write of
NT_METAG_RPIPE, so just don't bother.

This patch assumes that userspace will never rely on a partial SETREGSET
in this case, since it's not clear what should happen anyway.

Signed-off-by: Dave Martin <[email protected]>
Acked-by: James Hogan <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dave Martin authored and torvalds committed Mar 29, 2017
1 parent 5fe81fe commit 7195ee3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/metag/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ int metag_rp_state_copyin(struct pt_regs *regs,
unsigned long long *ptr;
int ret, i;

if (count < 4*13)
return -EINVAL;
/* Read the entire pipeline before making any changes */
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&rp, 0, 4*13);
Expand Down

0 comments on commit 7195ee3

Please sign in to comment.