linux/arch/powerpc/include/asm
Andrew Donnellan 61e3acd8c6 powerpc: Fix __clear_user() with KUAP enabled
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
2019-12-16 23:19:44 +11:00
..
book3s Merge branch 'akpm' (patches from Andrew) 2019-12-01 20:36:41 -08:00
nohash powerpc: permanently include 8xx registers in reg.h 2019-11-18 22:27:52 +11:00
8xx_immap.h
Kbuild pci-v5.5-changes 2019-12-03 13:58:22 -08:00
accounting.h
agp.h
archrandom.h powerpc/archrandom: fix arch_get_random_seed_int() 2019-12-05 08:21:16 +11:00
asm-405.h
asm-compat.h
asm-const.h
asm-offsets.h
asm-prototypes.h y2038: syscall implementation cleanups 2019-12-01 14:00:59 -08:00
async_tx.h
atomic.h
backlight.h
barrier.h
bitops.h powerpc: support KASAN instrumentation of bitops 2019-11-07 13:15:40 +11:00
bootx.h
btext.h
bug.h powerpc: Refactor BUG/WARN macros 2019-11-18 22:27:51 +11:00
bugs.h
cache.h powerpc: Convert flush_icache_range & friends to C 2019-11-07 23:35:37 +11:00
cacheflush.h powerpc: Convert flush_icache_range & friends to C 2019-11-07 23:35:37 +11:00
cell-pmu.h
cell-regs.h
checksum.h
cmpxchg.h
code-patching-asm.h
code-patching.h
compat.h
context_tracking.h
copro.h
cpm.h
cpm1.h
cpm2.h
cpu_has_feature.h
cpufeature.h
cpuidle.h
cputable.h
cputhreads.h
cputime.h
current.h
dbdma.h
dbell.h
dcr-generic.h
dcr-mmio.h
dcr-native.h
dcr-regs.h
dcr.h
debug.h
debugfs.h
delay.h
device.h
disassemble.h
dma-direct.h powerpc: remove support for NULL dev in __phys_to_dma / __dma_to_phys 2019-11-20 20:31:40 +01:00
dma.h
drmem.h
dt_cpu_ftrs.h
edac.h
eeh.h
eeh_event.h
ehv_pic.h
elf.h powerpc/prom_init: Undo relocation before entering secure mode 2019-10-29 15:12:17 +11:00
elfnote.h
emergency-restart.h
emulated_ops.h
epapr_hcalls.h
exception-64e.h
exception-64s.h
exec.h
extable.h
fadump-internal.h
fadump.h
fb.h
feature-fixups.h
firmware.h
fixmap.h powerpc/83xx: map IMMR with a BAT. 2019-11-19 19:38:38 +11:00
floppy.h
fs_pd.h
fsl_85xx_cache_sram.h
fsl_gtm.h
fsl_hcalls.h
fsl_lbc.h
fsl_pamu_stash.h
fsl_pm.h
ftrace.h
futex.h
grackle.h
hardirq.h
head-64.h
heathrow.h
highmem.h
hmi.h
hugetlb.h
hvcall.h KVM: PPC: Book3S HV: Shared pages support for secure guests 2019-11-28 16:47:38 +11:00
hvconsole.h
hvcserver.h
hvsi.h
hw_breakpoint.h powerpc/watchpoint: Fix ptrace code that muck around with address/len 2019-11-13 16:58:03 +11:00
hw_irq.h powerpc: cleanup hw_irq.h 2019-11-18 22:27:52 +11:00
hydra.h
i8259.h
ibmebus.h
icswx.h
ide.h
ima.h
imc-pmu.h
immap_cpm2.h
io-defs.h
io-workarounds.h
io.h
io_event_irq.h
iommu.h
ipic.h
irq.h
irq_work.h
irqflags.h
isa-bridge.h
jump_label.h
kasan.h
kdebug.h
kdump.h
kexec.h
keylargo.h
kgdb.h
kmap_types.h
kprobes.h
kup.h
kvm_asm.h
kvm_book3s.h
kvm_book3s_32.h
kvm_book3s_64.h
kvm_book3s_asm.h
kvm_book3s_uvmem.h KVM: PPC: Book3S HV: Handle memory plug/unplug to secure VM 2019-11-28 17:02:26 +11:00
kvm_booke.h
kvm_booke_hv_asm.h
kvm_fpu.h
kvm_host.h KVM: PPC: Book3S HV: Support for running secure guests 2019-11-28 16:30:02 +11:00
kvm_para.h
kvm_ppc.h KVM: PPC: Book3S HV: Support reset of secure guest 2019-11-28 17:02:31 +11:00
libata-portmap.h
linkage.h
livepatch.h
local.h powerpc: Add const qual to local_read() parameter 2019-11-24 15:06:33 -08:00
lppaca.h
lv1call.h
machdep.h
macio.h
mc146818rtc.h
mce.h
mediabay.h
mem_encrypt.h
membarrier.h
mm-arch-hooks.h
mman.h
mmiowb.h
mmu.h
mmu_context.h
mmzone.h
module.h
mpc5xxx.h
mpc6xx.h
mpc52xx.h
mpc52xx_psc.h
mpc85xx.h
mpc5121.h
mpc8260.h
mpic.h
mpic_msgr.h
mpic_timer.h
msi_bitmap.h
nmi.h
nvram.h
ohare.h
opal-api.h powerpc/powernv: Add OPAL API interface to access secure variable 2019-11-13 00:33:22 +11:00
opal.h powerpc/powernv: Add OPAL API interface to access secure variable 2019-11-13 00:33:22 +11:00
oprofile_impl.h
paca.h
page.h powerpc updates for 5.5 2019-11-30 14:35:43 -08:00
page_32.h
page_64.h
parport.h
pasemi_dma.h
pci-bridge.h
pci.h
percpu.h
perf_event.h
perf_event_fsl_emb.h
perf_event_server.h
pgalloc.h
pgtable-be-types.h
pgtable-types.h
pgtable.h powerpc/mm: drop #ifdef CONFIG_MMU in is_ioremap_addr() 2019-11-18 22:27:51 +11:00
pkeys.h
plpar_wrappers.h
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h
pmi.h
pnv-ocxl.h
pnv-pci.h
powernv.h
ppc-opcode.h
ppc-pci.h
ppc4xx.h
ppc_asm.h
probes.h
processor.h
prom.h
ps3.h
ps3av.h
ps3gpu.h
ps3stor.h
pte-walk.h
ptrace.h
reg.h powerpc updates for 5.5 2019-11-30 14:35:43 -08:00
reg_8xx.h powerpc: permanently include 8xx registers in reg.h 2019-11-18 22:27:52 +11:00
reg_a2.h
reg_booke.h
reg_fsl_emb.h
rheap.h
rio.h
rtas.h
runlatch.h
seccomp.h
sections.h powerpc: Define arch_is_kernel_initmem_freed() for lockdep 2019-11-27 18:41:26 +11:00
secure_boot.h powerpc: Detect the trusted boot state of the system 2019-11-12 12:25:49 +11:00
security_features.h powerpc updates for 5.5 2019-11-30 14:35:43 -08:00
secvar.h powerpc/powernv: Add OPAL API interface to access secure variable 2019-11-13 00:33:22 +11:00
serial.h
setjmp.h
setup.h
sfp-machine.h
shmparam.h
signal.h
slice.h
smp.h
smu.h
sparsemem.h
spinlock.h powerpc/shared: Use static key to detect shared processor 2019-12-13 21:07:45 +11:00
spinlock_types.h
spu.h
spu_csa.h
spu_info.h
spu_priv1.h
sstep.h
stackprotector.h
stacktrace.h
string.h
svm.h
swab.h
swiotlb.h
switch_to.h
synch.h
syscall.h
syscalls.h
task_size_32.h
task_size_64.h
tce.h
termios.h
thread_info.h
time.h
timex.h
tlb.h
tlbflush.h
tm.h
topology.h
trace.h
trace_clock.h
tsi108.h
tsi108_irq.h
tsi108_pci.h
types.h
uaccess.h powerpc: Fix __clear_user() with KUAP enabled 2019-12-16 23:19:44 +11:00
udbg.h
uic.h
ultravisor-api.h KVM: PPC: Book3S HV: Support reset of secure guest 2019-11-28 17:02:31 +11:00
ultravisor.h KVM: PPC: Book3S HV: Support reset of secure guest 2019-11-28 17:02:31 +11:00
unaligned.h
uninorth.h
unistd.h
uprobes.h
user.h
vas.h
vdso.h
vdso_datapage.h powerpc: Fix vDSO clock_getres() 2019-12-05 00:13:55 +11:00
vga.h
vio.h
word-at-a-time.h
xics.h
xilinx_intc.h
xilinx_pci.h
xive-regs.h
xive.h
xmon.h
xor.h
xor_altivec.h