From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
the arch/x86 maintainers <x86@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Remaining randconfig objtool warnings, linux-next-20200428
Date: Fri, 1 May 2020 14:33:19 +0200 [thread overview]
Message-ID: <20200501123319.GC3762@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200501010733.ptvgzl3nbxybo4rd@treble>
On Thu, Apr 30, 2020 at 08:07:33PM -0500, Josh Poimboeuf wrote:
> On Thu, Apr 30, 2020 at 04:05:07PM +0200, Arnd Bergmann wrote:
> > lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x133: call to do_strncpy_from_user() with UACCESS enabled
> > lib/strnlen_user.o: warning: objtool: strnlen_user()+0x122: call to do_strnlen_user() with UACCESS enabled
>
> Does this fix it?
>
GCC is a moron, a static function with inline and a single callsite,
let's out-of-line it, shees!, try this instead:
diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c
index 706020b06617..be420c8c0fdd 100644
--- a/lib/strncpy_from_user.c
+++ b/lib/strncpy_from_user.c
@@ -24,7 +24,7 @@
* hit it), 'max' is the address space maximum (and we return
* -EFAULT if we hit it).
*/
-static inline long do_strncpy_from_user(char *dst, const char __user *src,
+static __always_inline long do_strncpy_from_user(char *dst, const char __user *src,
unsigned long count, unsigned long max)
{
const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c
index 41670d4a5816..c996b745733e 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;
next prev parent reply other threads:[~2020-05-01 12:33 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 14:49 Remaining randconfig objtool warnings, linux-next-20200428 Arnd Bergmann
2020-04-28 16:10 ` Josh Poimboeuf
2020-04-28 19:11 ` Kees Cook
2020-04-28 20:19 ` Arnd Bergmann
2020-04-28 20:38 ` Josh Poimboeuf
2020-04-28 21:55 ` Peter Zijlstra
2020-04-28 22:03 ` Josh Poimboeuf
2020-04-28 22:33 ` Peter Zijlstra
2020-04-28 22:48 ` Josh Poimboeuf
2020-04-28 23:08 ` Josh Poimboeuf
2020-04-29 18:55 ` Josh Poimboeuf
2020-04-29 22:46 ` Arnd Bergmann
2020-04-29 23:01 ` Josh Poimboeuf
2020-04-29 23:11 ` Josh Poimboeuf
2020-04-29 23:28 ` Josh Poimboeuf
2020-04-30 13:41 ` Arnd Bergmann
2020-04-30 14:33 ` Josh Poimboeuf
2020-04-30 19:46 ` Josh Poimboeuf
2020-04-30 20:59 ` Arnd Bergmann
2020-04-30 21:10 ` Josh Poimboeuf
2020-04-30 21:08 ` Josh Poimboeuf
2020-04-30 23:02 ` Josh Poimboeuf
2020-04-29 19:18 ` Josh Poimboeuf
2020-05-01 12:23 ` Peter Zijlstra
2020-04-30 14:05 ` Arnd Bergmann
2020-05-01 0:28 ` Josh Poimboeuf
2020-05-01 11:41 ` Arnd Bergmann
2020-05-01 17:16 ` Peter Zijlstra
2020-05-01 12:27 ` Peter Zijlstra
2020-05-01 1:07 ` Josh Poimboeuf
2020-05-01 11:18 ` Arnd Bergmann
2020-05-01 12:33 ` Peter Zijlstra [this message]
2020-05-01 13:08 ` Arnd Bergmann
2020-05-01 15:49 ` Josh Poimboeuf
2020-05-01 17:21 ` Arnd Bergmann
2020-05-01 17:26 ` Peter Zijlstra
2020-05-01 17:50 ` Josh Poimboeuf
2020-05-01 19:47 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200501123319.GC3762@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=arnd@arndb.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox