Skip to content

Commit 573341e

Browse files
Dave Martingregkh
authored andcommitted
metag/ptrace: Reject partial NT_METAG_RPIPE writes
commit 7195ee3120d878259e8d94a5d9f808116f34d5ea upstream. 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 <Dave.Martin@arm.com> Acked-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e441102 commit 573341e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/metag/kernel/ptrace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ int metag_rp_state_copyin(struct pt_regs *regs,
253253
unsigned long long *ptr;
254254
int ret, i;
255255

256+
if (count < 4*13)
257+
return -EINVAL;
256258
/* Read the entire pipeline before making any changes */
257259
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
258260
&rp, 0, 4*13);

0 commit comments

Comments
 (0)