linux/arch/powerpc
Andrew Donnellan e83c40f7bb powerpc: Fix __clear_user() with KUAP enabled
commit 61e3acd8c6 upstream.

The KUAP implementation adds calls in clear_user() to enable and
disable access to userspace memory. However, it doesn't add these to
__clear_user(), which is used in the ptrace regset code.

As there's only one direct user of __clear_user() (the regset code),
and the time taken to set the AMR for KUAP purposes is going to
dominate the cost of a quick access_ok(), there's not much point
having a separate path.

Rename __clear_user() to __arch_clear_user(), and make __clear_user()
just call clear_user().

Reported-by: syzbot+f25ecf4b2982d8c7a640@syzkaller-ppc64.appspotmail.com
Reported-by: Daniel Axtens <dja@axtens.net>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Fixes: de78a9c42a ("powerpc: Add a framework for Kernel Userspace Access Protection")
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
[mpe: Use __arch_clear_user() for the asm version like arm64 & nds32]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191209132221.15328-1-ajd@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-04 19:18:37 +01:00
..
boot libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h 2020-01-04 19:18:28 +01:00
configs
crypto
include powerpc: Fix __clear_user() with KUAP enabled 2020-01-04 19:18:37 +01:00
kernel powerpc/book3s/mm: Update Oops message to print the correct translation in use 2020-01-04 19:18:10 +01:00
kvm KVM: PPC: Book3S HV: Fix regression on big endian hosts 2019-12-31 16:46:21 +01:00
lib powerpc: Fix __clear_user() with KUAP enabled 2020-01-04 19:18:37 +01:00
math-emu
mm powerpc/book3s64/hash: Add cond_resched to avoid soft lockup warning 2020-01-04 19:17:12 +01:00
net powerpc/bpf: Fix tail call implementation 2019-11-02 00:32:26 +01:00
oprofile
perf
platforms Revert "powerpc/vcpu: Assume dedicated processors as non-preempt" 2020-01-04 19:18:33 +01:00
purgatory
sysdev powerpc/xive: Skip ioremap() of ESB pages for LSI interrupts 2019-12-17 19:56:42 +01:00
tools powerpc/tools: Don't quote $objdump in scripts 2020-01-04 19:16:56 +01:00
xmon powerpc: Avoid clang warnings around setjmp and longjmp 2019-12-17 19:56:47 +01:00
Kbuild
Kconfig powerpc updates for 5.4 2019-09-20 11:48:06 -07:00
Kconfig.debug
Makefile powerpc: Don't add -mabi= flags when building with Clang 2020-01-04 19:18:23 +01:00
Makefile.postlink