diff options
author | Dave Martin <Dave.Martin@arm.com> | 2017-03-27 10:10:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-29 11:54:17 -0400 |
commit | 7195ee3120d878259e8d94a5d9f808116f34d5ea (patch) | |
tree | b985c17e25a8c43beae84495672ed5447270b34a | |
parent | 5fe81fe98123ce41265c65e95d34418d30d005d1 (diff) |
metag/ptrace: Reject partial NT_METAG_RPIPE writes
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>
-rw-r--r-- | arch/metag/kernel/ptrace.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/metag/kernel/ptrace.c b/arch/metag/kernel/ptrace.c index 2e4dfc15abd3..5e2dc7defd2c 100644 --- a/arch/metag/kernel/ptrace.c +++ b/arch/metag/kernel/ptrace.c | |||
@@ -253,6 +253,8 @@ int metag_rp_state_copyin(struct pt_regs *regs, | |||
253 | unsigned long long *ptr; | 253 | unsigned long long *ptr; |
254 | int ret, i; | 254 | int ret, i; |
255 | 255 | ||
256 | if (count < 4*13) | ||
257 | return -EINVAL; | ||
256 | /* Read the entire pipeline before making any changes */ | 258 | /* Read the entire pipeline before making any changes */ |
257 | ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, | 259 | ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, |
258 | &rp, 0, 4*13); | 260 | &rp, 0, 4*13); |