powerpc: Add a framework for Kernel Userspace Access Protection
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 18 Apr 2019 06:51:20 +0000 (16:51 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 21 Apr 2019 13:05:57 +0000 (23:05 +1000)
commitde78a9c42a790011f179bc94a7da3f5d8721f4cc
tree462ebea30f53f5f1e61513cbae38e40145ec030a
parent0fb1c25ab523614b056ace11be67aac8f8ccabb1
powerpc: Add a framework for Kernel Userspace Access Protection

This patch implements a framework for Kernel Userspace Access
Protection.

Then subarches will have the possibility to provide their own
implementation by providing setup_kuap() and
allow/prevent_user_access().

Some platforms will need to know the area accessed and whether it is
accessed from read, write or both. Therefore source, destination and
size and handed over to the two functions.

mpe: Rename to allow/prevent rather than unlock/lock, and add
read/write wrappers. Drop the 32-bit code for now until we have an
implementation for it. Add kuap to pt_regs for 64-bit as well as
32-bit. Don't split strings, use pr_crit_ratelimited().

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Documentation/admin-guide/kernel-parameters.txt
arch/powerpc/include/asm/futex.h
arch/powerpc/include/asm/kup.h
arch/powerpc/include/asm/ptrace.h
arch/powerpc/include/asm/uaccess.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/lib/checksum_wrappers.c
arch/powerpc/mm/fault.c
arch/powerpc/mm/init-common.c
arch/powerpc/platforms/Kconfig.cputype