diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2020-07-21 15:00:35 -0700 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-07-21 19:08:25 -0400 |
commit | 5fff09bc141570cd15c118b097b17dec832b517f (patch) | |
tree | 6a6d9d2ad48710aae48695e2b48a1beae5d5b817 /arch/xtensa | |
parent | b3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff) | |
download | linux-riscv-5fff09bc141570cd15c118b097b17dec832b517f.tar.gz linux-riscv-5fff09bc141570cd15c118b097b17dec832b517f.tar.bz2 linux-riscv-5fff09bc141570cd15c118b097b17dec832b517f.zip |
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/xtensa')
-rw-r--r-- | arch/xtensa/include/asm/checksum.h | 2 |
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) |