From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: build warnings after merge of the block tree
Date: Fri, 16 Jun 2023 14:43:54 +0200 [thread overview]
Message-ID: <20230616124354.GD4253@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230412162517.gji52t34zlvcu5bh@treble>
On Wed, Apr 12, 2023 at 09:25:17AM -0700, Josh Poimboeuf wrote:
> From: Josh Poimboeuf <jpoimboe@kernel.org>
> Subject: [PATCH] iov_iter: Mark copy_compat_iovec_from_user() noinline
>
> After commit 6376ce56feb6 ("iov_iter: import single vector iovecs as
> ITER_UBUF"), GCC does an inter-procedural compiler optimization which
> moves the user_access_begin() out of copy_compat_iovec_from_user() and
> into its callers:
>
> lib/iov_iter.o: warning: objtool: .altinstr_replacement+0x0: redundant UACCESS disable
> lib/iov_iter.o: warning: objtool: iovec_from_user.part.0+0xc7: call to copy_compat_iovec_from_user.part.0() with UACCESS enabled
> lib/iov_iter.o: warning: objtool: __import_iovec+0x21d: call to copy_compat_iovec_from_user.part.0() with UACCESS enabled
>
> Enforce the "no UACCESS enable across function boundaries" rule by
> disabling cloning for copy_compat_iovec_from_user().
>
> Fixes: 6376ce56feb6 ("iov_iter: import single vector iovecs as ITER_UBUF")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> https://lkml.kernel.org/lkml/20230327120017.6bb826d7@canb.auug.org.au
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
> lib/iov_iter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/iov_iter.c b/lib/iov_iter.c
> index 274014e4eafe..48aa9fd99267 100644
> --- a/lib/iov_iter.c
> +++ b/lib/iov_iter.c
> @@ -1698,7 +1698,7 @@ const void *dup_iter(struct iov_iter *new, struct iov_iter *old, gfp_t flags)
> }
> EXPORT_SYMBOL(dup_iter);
>
> -static int copy_compat_iovec_from_user(struct iovec *iov,
> +static __noclone int copy_compat_iovec_from_user(struct iovec *iov,
> const struct iovec __user *uvec, unsigned long nr_segs)
> {
> const struct compat_iovec __user *uiov =
I've been getting reports from some anonymous people still using ancient
GCCs (10.4) that also need the following:
---
Subject: iov_iter: Mark copy_iovec_from_user() noclone
Extend commit 50f9a76ef127 ("iov_iter: Mark
copy_compat_iovec_from_user() noinline") to also cover
copy_iovec_from_user(). Different compiler versions cause the same
problem on different functions.
lib/iov_iter.o: warning: objtool: .altinstr_replacement+0x1f: redundant UACCESS disable
lib/iov_iter.o: warning: objtool: iovec_from_user+0x84: call to copy_iovec_from_user.part.0() with UACCESS enabled
lib/iov_iter.o: warning: objtool: __import_iovec+0x143: call to copy_iovec_from_user.part.0() with UACCESS enabled
Fixes: 50f9a76ef127 ("iov_iter: Mark copy_compat_iovec_from_user() noinline")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 960223ed9199..061cc3ed58f5 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1795,7 +1795,7 @@ static __noclone int copy_compat_iovec_from_user(struct iovec *iov,
return ret;
}
-static int copy_iovec_from_user(struct iovec *iov,
+static __noclone int copy_iovec_from_user(struct iovec *iov,
const struct iovec __user *uiov, unsigned long nr_segs)
{
int ret = -EFAULT;
next prev parent reply other threads:[~2023-06-16 12:45 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 1:00 linux-next: build warnings after merge of the block tree Stephen Rothwell
2023-03-27 16:26 ` Josh Poimboeuf
2023-03-27 23:47 ` Stephen Rothwell
2023-04-11 21:34 ` Stephen Rothwell
2023-04-11 21:55 ` Josh Poimboeuf
2023-04-11 22:39 ` Jens Axboe
2023-04-12 0:14 ` Josh Poimboeuf
2023-04-12 1:48 ` Jens Axboe
2023-04-12 11:44 ` Peter Zijlstra
2023-04-12 16:25 ` Josh Poimboeuf
2023-04-12 16:35 ` Jens Axboe
2023-04-12 16:44 ` Jens Axboe
2023-04-12 16:56 ` Josh Poimboeuf
2023-04-12 17:57 ` Jens Axboe
2023-06-16 12:43 ` Peter Zijlstra [this message]
2023-06-16 12:49 ` Borislav Petkov
2023-07-03 11:04 ` Peter Zijlstra
2023-07-03 14:18 ` Jens Axboe
2023-07-03 15:14 ` Peter Zijlstra
2023-07-10 8:13 ` [tip: objtool/urgent] iov_iter: Mark copy_iovec_from_user() noclone tip-bot2 for Peter Zijlstra
2023-04-11 22:30 ` linux-next: build warnings after merge of the block tree Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2024-09-16 8:36 Stephen Rothwell
2024-09-16 8:49 ` Keith Busch
2024-09-27 3:43 ` Stephen Rothwell
2024-09-27 10:20 ` Jens Axboe
2024-10-03 3:18 ` Stephen Rothwell
2024-10-03 12:31 ` Jens Axboe
2024-02-06 2:10 Stephen Rothwell
2024-02-06 4:13 ` Stephen Rothwell
2024-02-06 11:12 ` Geert Uytterhoeven
2024-02-06 13:42 ` Geert Uytterhoeven
2024-02-06 14:53 ` Jens Axboe
2024-02-06 14:49 ` Jens Axboe
2023-07-27 6:10 Stephen Rothwell
2023-07-27 12:41 ` Jens Axboe
2022-07-15 11:51 Stephen Rothwell
2020-03-03 1:41 Stephen Rothwell
2020-03-03 2:59 ` Jens Axboe
2018-03-01 0:26 Stephen Rothwell
2018-03-01 4:02 ` Anshuman Khandual
2018-03-01 15:37 ` Jens Axboe
2013-11-26 2:29 Stephen Rothwell
2013-11-26 3:35 ` Stephen Rothwell
2013-11-26 19:01 ` Olof Johansson
2013-11-26 19:02 ` Jens Axboe
2011-01-07 0:02 Stephen Rothwell
2011-01-07 1:49 ` Mathieu Desnoyers
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=20230616124354.GD4253@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=axboe@kernel.dk \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.