aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-09-07 12:39:32 -0400
committerKees Cook <keescook@chromium.org>2016-09-07 14:33:26 -0400
commita85d6b8242dc78ef3f4542a0f979aebcbe77fc4e (patch)
tree71e873932fdbbeaa732c42bd059d4c85c7366af5
parentab29b33a84f6910ebf01a32f69a370886a4283dd (diff)
usercopy: force check_object_size() inline
Just for good measure, make sure that check_object_size() is always inlined too, as already done for copy_*_user() and __copy_*_user(). Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r--include/linux/thread_info.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index 10c9e601398b..2b5b10eed74f 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -118,8 +118,8 @@ static inline int arch_within_stack_frames(const void * const stack,
118extern void __check_object_size(const void *ptr, unsigned long n, 118extern void __check_object_size(const void *ptr, unsigned long n,
119 bool to_user); 119 bool to_user);
120 120
121static inline void check_object_size(const void *ptr, unsigned long n, 121static __always_inline void check_object_size(const void *ptr, unsigned long n,
122 bool to_user) 122 bool to_user)
123{ 123{
124 if (!__builtin_constant_p(n)) 124 if (!__builtin_constant_p(n))
125 __check_object_size(ptr, n, to_user); 125 __check_object_size(ptr, n, to_user);