From: Kees Cook Date: Wed, 7 Sep 2016 16:39:32 +0000 (-0700) Subject: usercopy: force check_object_size() inline X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a85d6b8242dc78ef3f4542a0f979aebcbe77fc4e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Kees Cook --- 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, extern void __check_object_size(const void *ptr, unsigned long n, bool to_user); -static inline void check_object_size(const void *ptr, unsigned long n, - bool to_user) +static __always_inline void check_object_size(const void *ptr, unsigned long n, + bool to_user) { if (!__builtin_constant_p(n)) __check_object_size(ptr, n, to_user);