aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-08-20 16:39:01 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-09-13 17:49:43 -0400
commit2e29f50ad5e23db37dde9be71410d95d50241ecd (patch)
treed084e591e3a0094fd38d5b9175e7e1f88fad4d45
parente33d1f6f72cc82fcfc3d1fb20c9e3ad83b1928fa (diff)
nios2: fix __get_user()
a) should not leave crap on fault b) should _not_ require access_ok() in any cases. Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/nios2/include/asm/uaccess.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/nios2/include/asm/uaccess.h b/arch/nios2/include/asm/uaccess.h
index 2b4b9e919675..0ab82324c817 100644
--- a/arch/nios2/include/asm/uaccess.h
+++ b/arch/nios2/include/asm/uaccess.h
@@ -142,7 +142,7 @@ extern long strnlen_user(const char __user *s, long n);
142 142
143#define __get_user_unknown(val, size, ptr, err) do { \ 143#define __get_user_unknown(val, size, ptr, err) do { \
144 err = 0; \ 144 err = 0; \
145 if (copy_from_user(&(val), ptr, size)) { \ 145 if (__copy_from_user(&(val), ptr, size)) { \
146 err = -EFAULT; \ 146 err = -EFAULT; \
147 } \ 147 } \
148 } while (0) 148 } while (0)
@@ -169,7 +169,7 @@ do { \
169 ({ \ 169 ({ \
170 long __gu_err = -EFAULT; \ 170 long __gu_err = -EFAULT; \
171 const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ 171 const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \
172 unsigned long __gu_val; \ 172 unsigned long __gu_val = 0; \
173 __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\ 173 __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
174 (x) = (__force __typeof__(x))__gu_val; \ 174 (x) = (__force __typeof__(x))__gu_val; \
175 __gu_err; \ 175 __gu_err; \