summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2020-07-22 01:00:35 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2020-07-22 02:08:25 +0300
commit5fff09bc141570cd15c118b097b17dec832b517f (patch)
tree6a6d9d2ad48710aae48695e2b48a1beae5d5b817 /arch
parentb3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff)
downloadlinux-5fff09bc141570cd15c118b097b17dec832b517f.tar.xz
xtensa: fix access check in csum_and_copy_from_user
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> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/xtensa/include/asm/checksum.h2
1 files changed, 1 insertions, 1 deletions
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)