diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-18 14:19:54 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-05-29 16:11:49 -0400 |
commit | 24f9aa928c3cc88bae573b39b6976844968f80a0 (patch) | |
tree | e4092ee465fb2be7f19930a9e36d2217852dc2b4 /arch/arm/include | |
parent | 7fe8970a78a1934545d53267281f1737eefea3bb (diff) | |
download | linux-stable-24f9aa928c3cc88bae573b39b6976844968f80a0.tar.gz linux-stable-24f9aa928c3cc88bae573b39b6976844968f80a0.tar.bz2 linux-stable-24f9aa928c3cc88bae573b39b6976844968f80a0.zip |
arm: switch to csum_and_copy_from_user()
Note that csum_partial_copy_from_user() is in assembler here,
so I'm leaving it alone and just providing the wrapper for
it. When/if we go for switching arm to user_access_{begin,end}()
(doing domain switches in those), somebody well need to look
into that one.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/checksum.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/include/asm/checksum.h b/arch/arm/include/asm/checksum.h index 20043e0ebb07..ed6073fee338 100644 --- a/arch/arm/include/asm/checksum.h +++ b/arch/arm/include/asm/checksum.h @@ -40,6 +40,20 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); __wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr); +#define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER +static inline +__wsum csum_and_copy_from_user (const void __user *src, void *dst, + int len, __wsum sum, int *err_ptr) +{ + if (access_ok(src, len)) + return csum_partial_copy_from_user(src, dst, len, sum, err_ptr); + + if (len) + *err_ptr = -EFAULT; + + return sum; +} + /* * Fold a partial checksum without adding pseudo headers */ |