Skip to content

Commit

Permalink
usercopy: force check_object_size() inline
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
kees committed Sep 7, 2016
1 parent ab29b33 commit a85d6b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a85d6b8

Please sign in to comment.