summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/book3s/32
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2020-04-03 07:20:53 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-01 12:37:15 +1000
commit4fe5cda9f89d0aea8e915b7c96ae34bda4e12e51 (patch)
treee727d7a8db04f52ecb7d9f0ca6e372520867d26d /arch/powerpc/include/asm/book3s/32
parent1f59cc3482c645c956a06e1b587e49df8d42ebab (diff)
downloadlinux-stable-4fe5cda9f89d0aea8e915b7c96ae34bda4e12e51.tar.gz
linux-stable-4fe5cda9f89d0aea8e915b7c96ae34bda4e12e51.tar.bz2
linux-stable-4fe5cda9f89d0aea8e915b7c96ae34bda4e12e51.zip
powerpc/uaccess: Implement user_read_access_begin and user_write_access_begin
Add support for selective read or write user access with user_read_access_begin/end and user_write_access_begin/end. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/6c83af0f0809ef2a955c39ac622767f6cbede035.1585898438.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc/include/asm/book3s/32')
-rw-r--r--arch/powerpc/include/asm/book3s/32/kup.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/book3s/32/kup.h b/arch/powerpc/include/asm/book3s/32/kup.h
index 3c0ba22dc360..1617e73bee30 100644
--- a/arch/powerpc/include/asm/book3s/32/kup.h
+++ b/arch/powerpc/include/asm/book3s/32/kup.h
@@ -108,7 +108,7 @@ static __always_inline void allow_user_access(void __user *to, const void __user
u32 addr, end;
BUILD_BUG_ON(!__builtin_constant_p(dir));
- BUILD_BUG_ON(dir == KUAP_CURRENT);
+ BUILD_BUG_ON(dir & ~KUAP_READ_WRITE);
if (!(dir & KUAP_WRITE))
return;
@@ -131,7 +131,7 @@ static __always_inline void prevent_user_access(void __user *to, const void __us
BUILD_BUG_ON(!__builtin_constant_p(dir));
- if (dir == KUAP_CURRENT) {
+ if (dir & KUAP_CURRENT_WRITE) {
u32 kuap = current->thread.kuap;
if (unlikely(!kuap))