linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xtensa: fix access check in csum_and_copy_from_user
@ 2020-07-21 22:00 Max Filippov
  2020-07-21 23:04 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Max Filippov @ 2020-07-21 22:00 UTC (permalink / raw)
  To: linux-xtensa; +Cc: Chris Zankel, linux-kernel, Max Filippov, Al Viro

Commit d341659f470b ("xtensa: switch to providing
csum_and_copy_from_user()") introduced access check, but incorrectly
tested dst instead of src.
Fix access_ok argument in csum_and_copy_from_user.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Fixes: d341659f470b ("xtensa: switch to providing csum_and_copy_from_user()")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/checksum.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/xtensa/include/asm/checksum.h b/arch/xtensa/include/asm/checksum.h
index d8292cc9ebdf..243a5fe79d3c 100644
--- a/arch/xtensa/include/asm/checksum.h
+++ b/arch/xtensa/include/asm/checksum.h
@@ -57,7 +57,7 @@ static inline
 __wsum csum_and_copy_from_user(const void __user *src, void *dst,
 				   int len, __wsum sum, int *err_ptr)
 {
-	if (access_ok(dst, len))
+	if (access_ok(src, len))
 		return csum_partial_copy_generic((__force const void *)src, dst,
 					len, sum, err_ptr, NULL);
 	if (len)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xtensa: fix access check in csum_and_copy_from_user
  2020-07-21 22:00 [PATCH] xtensa: fix access check in csum_and_copy_from_user Max Filippov
@ 2020-07-21 23:04 ` Al Viro
  2020-07-22  3:53   ` Max Filippov
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2020-07-21 23:04 UTC (permalink / raw)
  To: Max Filippov; +Cc: linux-xtensa, Chris Zankel, linux-kernel

On Tue, Jul 21, 2020 at 03:00:35PM -0700, Max Filippov wrote:
> Commit d341659f470b ("xtensa: switch to providing
> csum_and_copy_from_user()") introduced access check, but incorrectly
> tested dst instead of src.
> Fix access_ok argument in csum_and_copy_from_user.

Applied, with apologies...  Which tree do you want it to go through?
I'm dropping it into vfs.git#fixes, will send to Linus unless you
prefer it to go some other way...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xtensa: fix access check in csum_and_copy_from_user
  2020-07-21 23:04 ` Al Viro
@ 2020-07-22  3:53   ` Max Filippov
  0 siblings, 0 replies; 3+ messages in thread
From: Max Filippov @ 2020-07-22  3:53 UTC (permalink / raw)
  To: Al Viro; +Cc: open list:TENSILICA XTENSA PORT (xtensa), Chris Zankel, LKML

On Tue, Jul 21, 2020 at 4:04 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Tue, Jul 21, 2020 at 03:00:35PM -0700, Max Filippov wrote:
> > Commit d341659f470b ("xtensa: switch to providing
> > csum_and_copy_from_user()") introduced access check, but incorrectly
> > tested dst instead of src.
> > Fix access_ok argument in csum_and_copy_from_user.
>
> Applied, with apologies...  Which tree do you want it to go through?
> I'm dropping it into vfs.git#fixes, will send to Linus unless you
> prefer it to go some other way...

NP. Anything that will go into 5.8 is good.

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-22  3:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 22:00 [PATCH] xtensa: fix access check in csum_and_copy_from_user Max Filippov
2020-07-21 23:04 ` Al Viro
2020-07-22  3:53   ` Max Filippov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).