diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-07 09:29:36 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-07 09:29:36 -0700 |
| commit | 08411a7554248009f26e85635f445a209604bfb5 (patch) | |
| tree | 49e7af67ee59422c7b2129da1d8448e4c6a45724 /include/linux | |
| parent | d060e0f603a4156087813d221d818bb39ec91429 (diff) | |
| parent | 3c17648c2816f6d28bd2be9293032a2901994a36 (diff) | |
Merge tag 'usercopy-v4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardened usercopy fixes from Kees Cook:
- inline copy_*_user() for correct use of __builtin_const_p() for
hardened usercopy and the recent compile-time checks.
- switch hardened usercopy to only check non-const size arguments to
avoid meaningless checks on likely-sane const values.
- update lkdtm usercopy tests to compenstate for the const checking.
* tag 'usercopy-v4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
lkdtm: adjust usercopy tests to bypass const checks
usercopy: fold builtin_const check into inline function
x86/uaccess: force copy_*_user() to be inlined
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/thread_info.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index cbd8990e2e77..10c9e601398b 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -121,7 +121,8 @@ extern void __check_object_size(const void *ptr, unsigned long n, static inline void check_object_size(const void *ptr, unsigned long n, bool to_user) { - __check_object_size(ptr, n, to_user); + if (!__builtin_constant_p(n)) + __check_object_size(ptr, n, to_user); } #else static inline void check_object_size(const void *ptr, unsigned long n, |
