iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user()
[ Upstream commit 066baf92bed934c9fb4bcee97a193f47aa63431c ] copy_mc_to_user() has the destination marked __user on powerpc, but not on x86; the latter results in a sparse warning in lib/iov_iter.c. Fix this by applying the tag on x86 too. Fixes: ec6347bb4339 ("x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()") Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/20230925120309.1731676-3-dhowells@redhat.com cc: Dan Williams <dan.j.williams@intel.com> cc: Thomas Gleixner <tglx@linutronix.de> cc: Ingo Molnar <mingo@redhat.com> cc: Borislav Petkov <bp@alien8.de> cc: Dave Hansen <dave.hansen@linux.intel.com> cc: "H. Peter Anvin" <hpa@zytor.com> cc: Alexander Viro <viro@zeniv.linux.org.uk> cc: Jens Axboe <axboe@kernel.dk> cc: Christoph Hellwig <hch@lst.de> cc: Christian Brauner <christian@brauner.io> cc: Matthew Wilcox <willy@infradead.org> cc: Linus Torvalds <torvalds@linux-foundation.org> cc: David Laight <David.Laight@ACULAB.COM> cc: x86@kernel.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
115068e08d
commit
ad9d98524e
2 changed files with 5 additions and 5 deletions
|
@ -446,7 +446,7 @@ copy_mc_to_kernel(void *to, const void *from, unsigned len);
|
||||||
#define copy_mc_to_kernel copy_mc_to_kernel
|
#define copy_mc_to_kernel copy_mc_to_kernel
|
||||||
|
|
||||||
unsigned long __must_check
|
unsigned long __must_check
|
||||||
copy_mc_to_user(void *to, const void *from, unsigned len);
|
copy_mc_to_user(void __user *to, const void *from, unsigned len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -74,23 +74,23 @@ unsigned long __must_check copy_mc_to_kernel(void *dst, const void *src, unsigne
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(copy_mc_to_kernel);
|
EXPORT_SYMBOL_GPL(copy_mc_to_kernel);
|
||||||
|
|
||||||
unsigned long __must_check copy_mc_to_user(void *dst, const void *src, unsigned len)
|
unsigned long __must_check copy_mc_to_user(void __user *dst, const void *src, unsigned len)
|
||||||
{
|
{
|
||||||
unsigned long ret;
|
unsigned long ret;
|
||||||
|
|
||||||
if (copy_mc_fragile_enabled) {
|
if (copy_mc_fragile_enabled) {
|
||||||
__uaccess_begin();
|
__uaccess_begin();
|
||||||
ret = copy_mc_fragile(dst, src, len);
|
ret = copy_mc_fragile((__force void *)dst, src, len);
|
||||||
__uaccess_end();
|
__uaccess_end();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (static_cpu_has(X86_FEATURE_ERMS)) {
|
if (static_cpu_has(X86_FEATURE_ERMS)) {
|
||||||
__uaccess_begin();
|
__uaccess_begin();
|
||||||
ret = copy_mc_enhanced_fast_string(dst, src, len);
|
ret = copy_mc_enhanced_fast_string((__force void *)dst, src, len);
|
||||||
__uaccess_end();
|
__uaccess_end();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return copy_user_generic(dst, src, len);
|
return copy_user_generic((__force void *)dst, src, len);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue