Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 50f9a76

Browse files
jpoimboeaxboe
authored andcommitted
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 <[email protected]> https://lkml.kernel.org/lkml/[email protected] Signed-off-by: Josh Poimboeuf <[email protected]> Tested-by: Jens Axboe <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3b2deb0 commit 50f9a76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/iov_iter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ const void *dup_iter(struct iov_iter *new, struct iov_iter *old, gfp_t flags)
17021702
}
17031703
EXPORT_SYMBOL(dup_iter);
17041704

1705-
static int copy_compat_iovec_from_user(struct iovec *iov,
1705+
static __noclone int copy_compat_iovec_from_user(struct iovec *iov,
17061706
const struct iovec __user *uvec, unsigned long nr_segs)
17071707
{
17081708
const struct compat_iovec __user *uiov =

0 commit comments

Comments
 (0)