diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-03 18:05:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-27 21:15:20 -0400 |
commit | 81029b1f775ad55caeaa8f7f260273969a4a282e (patch) | |
tree | 8f70e9f9cc5c441387a2a9586df73c1f579f9d9e | |
parent | 08435d89dd5890c3e72dbdc0f47e7b06f0012447 (diff) |
mn10300: finish verify_area() off
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/mn10300/include/asm/uaccess.h | 6 | ||||
-rw-r--r-- | arch/mn10300/kernel/signal.c | 6 |
2 files changed, 3 insertions, 9 deletions
diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h index d012e877a95a..bd285e5fd93a 100644 --- a/arch/mn10300/include/asm/uaccess.h +++ b/arch/mn10300/include/asm/uaccess.h | |||
@@ -72,12 +72,6 @@ static inline int ___range_ok(unsigned long addr, unsigned int size) | |||
72 | #define access_ok(type, addr, size) (__range_ok((addr), (size)) == 0) | 72 | #define access_ok(type, addr, size) (__range_ok((addr), (size)) == 0) |
73 | #define __access_ok(addr, size) (__range_ok((addr), (size)) == 0) | 73 | #define __access_ok(addr, size) (__range_ok((addr), (size)) == 0) |
74 | 74 | ||
75 | static inline int verify_area(int type, const void *addr, unsigned long size) | ||
76 | { | ||
77 | return access_ok(type, addr, size) ? 0 : -EFAULT; | ||
78 | } | ||
79 | |||
80 | |||
81 | /* | 75 | /* |
82 | * The exception table consists of pairs of addresses: the first is the | 76 | * The exception table consists of pairs of addresses: the first is the |
83 | * address of an instruction that is allowed to fault, and the second is | 77 | * address of an instruction that is allowed to fault, and the second is |
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index dfd0301cf200..cd8cb1d1176b 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c | |||
@@ -75,7 +75,7 @@ static int restore_sigcontext(struct pt_regs *regs, | |||
75 | struct fpucontext *buf; | 75 | struct fpucontext *buf; |
76 | err |= __get_user(buf, &sc->fpucontext); | 76 | err |= __get_user(buf, &sc->fpucontext); |
77 | if (buf) { | 77 | if (buf) { |
78 | if (verify_area(VERIFY_READ, buf, sizeof(*buf))) | 78 | if (!access_ok(VERIFY_READ, buf, sizeof(*buf))) |
79 | goto badframe; | 79 | goto badframe; |
80 | err |= fpu_restore_sigcontext(buf); | 80 | err |= fpu_restore_sigcontext(buf); |
81 | } | 81 | } |
@@ -98,7 +98,7 @@ asmlinkage long sys_sigreturn(void) | |||
98 | long d0; | 98 | long d0; |
99 | 99 | ||
100 | frame = (struct sigframe __user *) current_frame()->sp; | 100 | frame = (struct sigframe __user *) current_frame()->sp; |
101 | if (verify_area(VERIFY_READ, frame, sizeof(*frame))) | 101 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
102 | goto badframe; | 102 | goto badframe; |
103 | if (__get_user(set.sig[0], &frame->sc.oldmask)) | 103 | if (__get_user(set.sig[0], &frame->sc.oldmask)) |
104 | goto badframe; | 104 | goto badframe; |
@@ -130,7 +130,7 @@ asmlinkage long sys_rt_sigreturn(void) | |||
130 | long d0; | 130 | long d0; |
131 | 131 | ||
132 | frame = (struct rt_sigframe __user *) current_frame()->sp; | 132 | frame = (struct rt_sigframe __user *) current_frame()->sp; |
133 | if (verify_area(VERIFY_READ, frame, sizeof(*frame))) | 133 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
134 | goto badframe; | 134 | goto badframe; |
135 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 135 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
136 | goto badframe; | 136 | goto badframe; |