Commit c44ac3c8 authored by Al Viro's avatar Al Viro

mips: csum_and_copy_{to,from}_user() are never called under KERNEL_DS

they are only called for iovec-backed iov_iter and under KERNEL_DS an
attempt to create such a beast will yield a kvec-backed one.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ab5e8b33
...@@ -41,22 +41,6 @@ __wsum __csum_partial_copy_from_user(const void *src, void *dst, ...@@ -41,22 +41,6 @@ __wsum __csum_partial_copy_from_user(const void *src, void *dst,
int len, __wsum sum, int *err_ptr); int len, __wsum sum, int *err_ptr);
__wsum __csum_partial_copy_to_user(const void *src, void *dst, __wsum __csum_partial_copy_to_user(const void *src, void *dst,
int len, __wsum sum, int *err_ptr); int len, __wsum sum, int *err_ptr);
/*
* this is a new version of the above that records errors it finds in *errp,
* but continues and zeros the rest of the buffer.
*/
static inline
__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len,
__wsum sum, int *err_ptr)
{
might_fault();
if (uaccess_kernel())
return __csum_partial_copy_kernel((__force void *)src, dst,
len, sum, err_ptr);
else
return __csum_partial_copy_from_user((__force void *)src, dst,
len, sum, err_ptr);
}
#define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER #define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
static inline static inline
...@@ -65,9 +49,12 @@ __wsum csum_and_copy_from_user(const void __user *src, void *dst, int len) ...@@ -65,9 +49,12 @@ __wsum csum_and_copy_from_user(const void __user *src, void *dst, int len)
__wsum sum = ~0U; __wsum sum = ~0U;
int err = 0; int err = 0;
might_fault();
if (!access_ok(src, len)) if (!access_ok(src, len))
return 0; return 0;
sum = csum_partial_copy_from_user(src, dst, len, sum, &err); sum = __csum_partial_copy_from_user((__force void *)src, dst,
len, sum, &err);
return err ? 0 : sum; return err ? 0 : sum;
} }
...@@ -84,11 +71,6 @@ __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len) ...@@ -84,11 +71,6 @@ __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len)
might_fault(); might_fault();
if (!access_ok(dst, len)) if (!access_ok(dst, len))
return 0; return 0;
if (uaccess_kernel())
sum = __csum_partial_copy_kernel(src,
(__force void *)dst,
len, sum, &err);
else
sum = __csum_partial_copy_to_user(src, sum = __csum_partial_copy_to_user(src,
(__force void *)dst, (__force void *)dst,
len, sum, &err); len, sum, &err);
......
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