aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/uaccess.h')
-rw-r--r--arch/s390/include/asm/uaccess.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 34268df959a3..9c33ed4e666f 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -252,9 +252,7 @@ static inline unsigned long __must_check
252copy_to_user(void __user *to, const void *from, unsigned long n) 252copy_to_user(void __user *to, const void *from, unsigned long n)
253{ 253{
254 might_fault(); 254 might_fault();
255 if (access_ok(VERIFY_WRITE, to, n)) 255 return __copy_to_user(to, from, n);
256 n = __copy_to_user(to, from, n);
257 return n;
258} 256}
259 257
260/** 258/**
@@ -315,11 +313,7 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
315 copy_from_user_overflow(); 313 copy_from_user_overflow();
316 return n; 314 return n;
317 } 315 }
318 if (access_ok(VERIFY_READ, from, n)) 316 return __copy_from_user(to, from, n);
319 n = __copy_from_user(to, from, n);
320 else
321 memset(to, 0, n);
322 return n;
323} 317}
324 318
325static inline unsigned long __must_check 319static inline unsigned long __must_check
@@ -332,9 +326,7 @@ static inline unsigned long __must_check
332copy_in_user(void __user *to, const void __user *from, unsigned long n) 326copy_in_user(void __user *to, const void __user *from, unsigned long n)
333{ 327{
334 might_fault(); 328 might_fault();
335 if (__access_ok(from,n) && __access_ok(to,n)) 329 return __copy_in_user(to, from, n);
336 n = __copy_in_user(to, from, n);
337 return n;
338} 330}
339 331
340/* 332/*
@@ -343,11 +335,8 @@ copy_in_user(void __user *to, const void __user *from, unsigned long n)
343static inline long __must_check 335static inline long __must_check
344strncpy_from_user(char *dst, const char __user *src, long count) 336strncpy_from_user(char *dst, const char __user *src, long count)
345{ 337{
346 long res = -EFAULT;
347 might_fault(); 338 might_fault();
348 if (access_ok(VERIFY_READ, src, 1)) 339 return uaccess.strncpy_from_user(count, src, dst);
349 res = uaccess.strncpy_from_user(count, src, dst);
350 return res;
351} 340}
352 341
353static inline unsigned long 342static inline unsigned long
@@ -387,9 +376,7 @@ static inline unsigned long __must_check
387clear_user(void __user *to, unsigned long n) 376clear_user(void __user *to, unsigned long n)
388{ 377{
389 might_fault(); 378 might_fault();
390 if (access_ok(VERIFY_WRITE, to, n)) 379 return uaccess.clear_user(n, to);
391 n = uaccess.clear_user(n, to);
392 return n;
393} 380}
394 381
395extern int copy_to_user_real(void __user *dest, void *src, size_t count); 382extern int copy_to_user_real(void __user *dest, void *src, size_t count);