Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 4de5b63e 0f9b38cd

+17 -48
+1
arch/arm/Kconfig
··· 96 96 select PERF_USE_VMALLOC 97 97 select RTC_LIB 98 98 select SYS_SUPPORTS_APM_EMULATION 99 + select ARCH_HAS_RAW_COPY_USER 99 100 # Above selects are sorted alphabetically; please add new ones 100 101 # according to that. Thanks. 101 102 help
+16 -48
arch/arm/include/asm/uaccess.h
··· 455 455 arm_copy_from_user(void *to, const void __user *from, unsigned long n); 456 456 457 457 static inline unsigned long __must_check 458 - __arch_copy_from_user(void *to, const void __user *from, unsigned long n) 458 + raw_copy_from_user(void *to, const void __user *from, unsigned long n) 459 459 { 460 460 unsigned int __ua_flags; 461 461 ··· 471 471 __copy_to_user_std(void __user *to, const void *from, unsigned long n); 472 472 473 473 static inline unsigned long __must_check 474 - __arch_copy_to_user(void __user *to, const void *from, unsigned long n) 474 + raw_copy_to_user(void __user *to, const void *from, unsigned long n) 475 475 { 476 476 #ifndef CONFIG_UACCESS_WITH_MEMCPY 477 477 unsigned int __ua_flags; ··· 499 499 } 500 500 501 501 #else 502 - #define __arch_copy_from_user(to, from, n) \ 503 - (memcpy(to, (void __force *)from, n), 0) 504 - #define __arch_copy_to_user(to, from, n) \ 505 - (memcpy((void __force *)to, from, n), 0) 502 + static inline unsigned long 503 + raw_copy_from_user(void *to, const void __user *from, unsigned long n) 504 + { 505 + memcpy(to, (const void __force *)from, n); 506 + return 0; 507 + } 508 + static inline unsigned long 509 + raw_copy_to_user(void __user *to, const void *from, unsigned long n) 510 + { 511 + memcpy((void __force *)to, from, n); 512 + return 0; 513 + } 506 514 #define __clear_user(addr, n) (memset((void __force *)addr, 0, n), 0) 507 515 #endif 508 - 509 - static inline unsigned long __must_check 510 - __copy_from_user(void *to, const void __user *from, unsigned long n) 511 - { 512 - check_object_size(to, n, false); 513 - return __arch_copy_from_user(to, from, n); 514 - } 515 - 516 - static inline unsigned long __must_check 517 - copy_from_user(void *to, const void __user *from, unsigned long n) 518 - { 519 - unsigned long res = n; 520 - 521 - check_object_size(to, n, false); 522 - 523 - if (likely(access_ok(VERIFY_READ, from, n))) 524 - res = __arch_copy_from_user(to, from, n); 525 - if (unlikely(res)) 526 - memset(to + (n - res), 0, res); 527 - return res; 528 - } 529 - 530 - static inline unsigned long __must_check 531 - __copy_to_user(void __user *to, const void *from, unsigned long n) 532 - { 533 - check_object_size(from, n, true); 534 - 535 - return __arch_copy_to_user(to, from, n); 536 - } 537 - 538 - static inline unsigned long __must_check 539 - copy_to_user(void __user *to, const void *from, unsigned long n) 540 - { 541 - check_object_size(from, n, true); 542 - 543 - if (access_ok(VERIFY_WRITE, to, n)) 544 - n = __arch_copy_to_user(to, from, n); 545 - return n; 546 - } 547 - 548 - #define __copy_to_user_inatomic __copy_to_user 549 - #define __copy_from_user_inatomic __copy_from_user 516 + #define INLINE_COPY_TO_USER 517 + #define INLINE_COPY_FROM_USER 550 518 551 519 static inline unsigned long __must_check clear_user(void __user *to, unsigned long n) 552 520 {