diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-11 20:39:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-11 20:39:08 -0500 |
commit | ae795fe760e20a7c6ad0f2cd24fc31afad73f427 (patch) | |
tree | 06e1064d5f4f10aa4838c0748773e4328b07e535 /arch/x86/lib | |
parent | b7ab6e3d21b17a5b488aeb49bd415a9433b8a79e (diff) | |
parent | 7a3d9b0f3abbea957b829cdfff8169872c575642 (diff) |
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 user access changes from Ingo Molnar:
"This tree contains two copy_[from/to]_user() build time checking
changes/enhancements from Jan Beulich.
The desired outcome is to get better compiler warnings with
CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y, to keep people from
introducing bugs such as overflows and information leaks"
* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86: Unify copy_to_user() and add size checking to it
x86: Unify copy_from_user() size checking
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/usercopy_32.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c index 3eb18acd0e40..e2f5e21c03b3 100644 --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c | |||
@@ -654,14 +654,13 @@ EXPORT_SYMBOL(__copy_from_user_ll_nocache_nozero); | |||
654 | * Returns number of bytes that could not be copied. | 654 | * Returns number of bytes that could not be copied. |
655 | * On success, this will be zero. | 655 | * On success, this will be zero. |
656 | */ | 656 | */ |
657 | unsigned long | 657 | unsigned long _copy_to_user(void __user *to, const void *from, unsigned n) |
658 | copy_to_user(void __user *to, const void *from, unsigned long n) | ||
659 | { | 658 | { |
660 | if (access_ok(VERIFY_WRITE, to, n)) | 659 | if (access_ok(VERIFY_WRITE, to, n)) |
661 | n = __copy_to_user(to, from, n); | 660 | n = __copy_to_user(to, from, n); |
662 | return n; | 661 | return n; |
663 | } | 662 | } |
664 | EXPORT_SYMBOL(copy_to_user); | 663 | EXPORT_SYMBOL(_copy_to_user); |
665 | 664 | ||
666 | /** | 665 | /** |
667 | * copy_from_user: - Copy a block of data from user space. | 666 | * copy_from_user: - Copy a block of data from user space. |
@@ -679,8 +678,7 @@ EXPORT_SYMBOL(copy_to_user); | |||
679 | * If some data could not be copied, this function will pad the copied | 678 | * If some data could not be copied, this function will pad the copied |
680 | * data to the requested size using zero bytes. | 679 | * data to the requested size using zero bytes. |
681 | */ | 680 | */ |
682 | unsigned long | 681 | unsigned long _copy_from_user(void *to, const void __user *from, unsigned n) |
683 | _copy_from_user(void *to, const void __user *from, unsigned long n) | ||
684 | { | 682 | { |
685 | if (access_ok(VERIFY_READ, from, n)) | 683 | if (access_ok(VERIFY_READ, from, n)) |
686 | n = __copy_from_user(to, from, n); | 684 | n = __copy_from_user(to, from, n); |