Commit 5fff09bc authored by Max Filippov's avatar Max Filippov Committed by Al Viro

xtensa: fix access check in csum_and_copy_from_user

Commit d341659f ("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: d341659f ("xtensa: switch to providing csum_and_copy_from_user()")
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b3a9e3b9
...@@ -57,7 +57,7 @@ static inline ...@@ -57,7 +57,7 @@ static inline
__wsum csum_and_copy_from_user(const void __user *src, void *dst, __wsum csum_and_copy_from_user(const void __user *src, void *dst,
int len, __wsum sum, int *err_ptr) 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, return csum_partial_copy_generic((__force const void *)src, dst,
len, sum, err_ptr, NULL); len, sum, err_ptr, NULL);
if (len) if (len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment