[PATCH 3/5] powerpc/lib: checksum GUAP support
LEROY Christophe
christophe.leroy at c-s.fr
Sat Oct 27 03:33:37 AEDT 2018
Same comment as for futex
Christophe
Russell Currey <ruscur at russell.cc> a écrit :
> Wrap the checksumming code in GUAP locks and unlocks.
>
> Signed-off-by: Russell Currey <ruscur at russell.cc>
> ---
> arch/powerpc/lib/checksum_wrappers.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/lib/checksum_wrappers.c
> b/arch/powerpc/lib/checksum_wrappers.c
> index a0cb63fb76a1..c67db0a6e18b 100644
> --- a/arch/powerpc/lib/checksum_wrappers.c
> +++ b/arch/powerpc/lib/checksum_wrappers.c
> @@ -28,6 +28,7 @@ __wsum csum_and_copy_from_user(const void __user
> *src, void *dst,
> {
> unsigned int csum;
>
> + unlock_user_access();
> might_sleep();
>
> *err_ptr = 0;
> @@ -60,6 +61,7 @@ __wsum csum_and_copy_from_user(const void __user
> *src, void *dst,
> }
>
> out:
> + lock_user_access();
> return (__force __wsum)csum;
> }
> EXPORT_SYMBOL(csum_and_copy_from_user);
> @@ -69,6 +71,7 @@ __wsum csum_and_copy_to_user(const void *src, void
> __user *dst, int len,
> {
> unsigned int csum;
>
> + unlock_user_access();
> might_sleep();
>
> *err_ptr = 0;
> @@ -97,6 +100,7 @@ __wsum csum_and_copy_to_user(const void *src,
> void __user *dst, int len,
> }
>
> out:
> + lock_user_access();
> return (__force __wsum)csum;
> }
> EXPORT_SYMBOL(csum_and_copy_to_user);
> --
> 2.19.1
More information about the Linuxppc-dev
mailing list