summaryrefslogtreecommitdiff
path: root/arch/metag
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2017-03-27 17:10:57 +0300
committerSasha Levin <alexander.levin@microsoft.com>2018-01-17 20:32:51 +0300
commit21af28db5ef7c8bed49f9dfaaa9ad410032b635e (patch)
treef438cf829d7d7ef07b7a0c0366d91fb59cf8d76e /arch/metag
parent6779b4582eca8357ee731e95185c0f9f20abf71b (diff)
downloadlinux-21af28db5ef7c8bed49f9dfaaa9ad410032b635e.tar.xz
metag/ptrace: Reject partial NT_METAG_RPIPE writes
[ Upstream commit 7195ee3120d878259e8d94a5d9f808116f34d5ea ] 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: Sasha Levin <alexander.levin@microsoft.com>
Diffstat (limited to 'arch/metag')
-rw-r--r--arch/metag/kernel/ptrace.c2
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,
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);