aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/kup.h
diff options
context:
space:
mode:
authorGravatar Christophe Leroy <christophe.leroy@c-s.fr> 2020-01-24 11:54:45 +0000
committerGravatar Michael Ellerman <mpe@ellerman.id.au> 2020-01-28 23:14:44 +1100
commit3d7dfd632f9b60cfce069b4da517e6b1a1c3f613 (patch)
tree02ec1e93d286d7c49dce90a4294f8ddc1edb3af4 /arch/powerpc/include/asm/kup.h
parentpowerpc: Implement user_access_begin and friends (diff)
downloadlinux-3d7dfd632f9b60cfce069b4da517e6b1a1c3f613.tar.gz
linux-3d7dfd632f9b60cfce069b4da517e6b1a1c3f613.tar.bz2
linux-3d7dfd632f9b60cfce069b4da517e6b1a1c3f613.zip
powerpc: Implement user_access_save() and user_access_restore()
Implement user_access_save() and user_access_restore() On 8xx and radix: - On save, get the value of the associated special register then prevent user access. - On restore, set back the saved value to the associated special register. On book3s/32: - On save, get the value stored in current->thread.kuap and prevent user access. - On restore, regenerate address range from the stored value and reopen read/write access for that range. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/54f2f74938006b33c55a416674807b42ef222068.1579866752.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc/include/asm/kup.h')
-rw-r--r--arch/powerpc/include/asm/kup.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kup.h b/arch/powerpc/include/asm/kup.h
index c3ce7e8ae9ea..92bcd1a26d73 100644
--- a/arch/powerpc/include/asm/kup.h
+++ b/arch/powerpc/include/asm/kup.h
@@ -55,6 +55,8 @@ static inline void allow_user_access(void __user *to, const void __user *from,
unsigned long size, unsigned long dir) { }
static inline void prevent_user_access(void __user *to, const void __user *from,
unsigned long size, unsigned long dir) { }
+static inline unsigned long prevent_user_access_return(void) { return 0UL; }
+static inline void restore_user_access(unsigned long flags) { }
static inline bool
bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)
{