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>
This commit is contained in:
Kees Cook 2016-09-07 09:39:32 -07:00
Родитель ab29b33a84
Коммит a85d6b8242
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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, extern void __check_object_size(const void *ptr, unsigned long n,
bool to_user); bool to_user);
static inline void check_object_size(const void *ptr, unsigned long n, static __always_inline void check_object_size(const void *ptr, unsigned long n,
bool to_user) bool to_user)
{ {
if (!__builtin_constant_p(n)) if (!__builtin_constant_p(n))
__check_object_size(ptr, n, to_user); __check_object_size(ptr, n, to_user);