diff options
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 2 | ||||
-rw-r--r-- | include/asm-s390/uaccess.h | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index ed877d0f27e6..41b197a3f3a3 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -279,7 +279,7 @@ asmlinkage long sys32_getegid16(void) | |||
279 | 279 | ||
280 | static inline long get_tv32(struct timeval *o, struct compat_timeval *i) | 280 | static inline long get_tv32(struct timeval *o, struct compat_timeval *i) |
281 | { | 281 | { |
282 | return (!access_ok(VERIFY_READ, tv32, sizeof(*tv32)) || | 282 | return (!access_ok(VERIFY_READ, o, sizeof(*o)) || |
283 | (__get_user(o->tv_sec, &i->tv_sec) || | 283 | (__get_user(o->tv_sec, &i->tv_sec) || |
284 | __get_user(o->tv_usec, &i->tv_usec))); | 284 | __get_user(o->tv_usec, &i->tv_usec))); |
285 | } | 285 | } |
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index 10a619da4761..be104f21c70a 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h | |||
@@ -61,8 +61,10 @@ | |||
61 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) | 61 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) |
62 | 62 | ||
63 | 63 | ||
64 | #define __access_ok(addr,size) (1) | 64 | static inline int __access_ok(const void *addr, unsigned long size) |
65 | 65 | { | |
66 | return 1; | ||
67 | } | ||
66 | #define access_ok(type,addr,size) __access_ok(addr,size) | 68 | #define access_ok(type,addr,size) __access_ok(addr,size) |
67 | 69 | ||
68 | /* | 70 | /* |
@@ -206,25 +208,25 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
206 | case 1: { \ | 208 | case 1: { \ |
207 | unsigned char __x; \ | 209 | unsigned char __x; \ |
208 | __get_user_asm(__x, ptr, __gu_err); \ | 210 | __get_user_asm(__x, ptr, __gu_err); \ |
209 | (x) = (__typeof__(*(ptr))) __x; \ | 211 | (x) = *(__typeof__(*(ptr)) *) &__x; \ |
210 | break; \ | 212 | break; \ |
211 | }; \ | 213 | }; \ |
212 | case 2: { \ | 214 | case 2: { \ |
213 | unsigned short __x; \ | 215 | unsigned short __x; \ |
214 | __get_user_asm(__x, ptr, __gu_err); \ | 216 | __get_user_asm(__x, ptr, __gu_err); \ |
215 | (x) = (__typeof__(*(ptr))) __x; \ | 217 | (x) = *(__typeof__(*(ptr)) *) &__x; \ |
216 | break; \ | 218 | break; \ |
217 | }; \ | 219 | }; \ |
218 | case 4: { \ | 220 | case 4: { \ |
219 | unsigned int __x; \ | 221 | unsigned int __x; \ |
220 | __get_user_asm(__x, ptr, __gu_err); \ | 222 | __get_user_asm(__x, ptr, __gu_err); \ |
221 | (x) = (__typeof__(*(ptr))) __x; \ | 223 | (x) = *(__typeof__(*(ptr)) *) &__x; \ |
222 | break; \ | 224 | break; \ |
223 | }; \ | 225 | }; \ |
224 | case 8: { \ | 226 | case 8: { \ |
225 | unsigned long long __x; \ | 227 | unsigned long long __x; \ |
226 | __get_user_asm(__x, ptr, __gu_err); \ | 228 | __get_user_asm(__x, ptr, __gu_err); \ |
227 | (x) = (__typeof__(*(ptr))) __x; \ | 229 | (x) = *(__typeof__(*(ptr)) *) &__x; \ |
228 | break; \ | 230 | break; \ |
229 | }; \ | 231 | }; \ |
230 | default: \ | 232 | default: \ |