diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-04-08 12:45:53 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-04-19 22:58:47 +0300 |
commit | 226d44acf6dfe71c9df5804b82364e93cf908b53 (patch) | |
tree | 13ec221fd203a3ac03fe7e42459ee5bec67f7e88 /lib/strnlen_user.c | |
parent | 610abf3dea1092445b4b185e14ed130d1ec6aa74 (diff) |
lib/strn*,objtool: Enforce user_access_begin() rules
Apparently GCC can fail to inline a 'static inline' single caller
function:
lib/strnlen_user.o: warning: objtool: strnlen_user()+0x33: call to do_strnlen_user() with UACCESS enabled
lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x33: call to do_strncpy_from_user() with UACCESS enabled
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220408094718.262932488@infradead.org
Diffstat (limited to 'lib/strnlen_user.c')
-rw-r--r-- | lib/strnlen_user.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c index bffa0ebf9f8b..feeb935a2299 100644 --- a/lib/strnlen_user.c +++ b/lib/strnlen_user.c @@ -20,7 +20,7 @@ * if it fits in a aligned 'long'. The caller needs to check * the return value against "> max". */ -static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) +static __always_inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) { const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; unsigned long align, res = 0; |