linux_dsm_epyc7002/arch/powerpc/kernel
Michael Neuling cf13435b73 powerpc/tm: Fix userspace r13 corruption
When we treclaim we store the userspace checkpointed r13 to a scratch
SPR and then later save the scratch SPR to the user thread struct.

Unfortunately, this doesn't work as accessing the user thread struct
can take an SLB fault and the SLB fault handler will write the same
scratch SPRG that now contains the userspace r13.

To fix this, we store r13 to the kernel stack (which can't fault)
before we access the user thread struct.

Found by running P8 guest + powervm + disable_1tb_segments + TM. Seen
as a random userspace segfault with r13 looking like a kernel address.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-09-25 22:51:08 +10:00
..
trace powerpc/kprobes: Remove jprobe powerpc implementation 2018-06-21 12:33:08 +02:00
vdso32 powerpc: Add build salt to the vDSO 2018-07-18 01:18:05 +09:00
vdso64
.gitignore
align.c
asm-offsets.c powerpc/64s: Remove POWER9 DD1 support 2018-07-16 11:37:21 +10:00
audit.c
btext.c
cacheinfo.c
cacheinfo.h
compat_audit.c
cpu_setup_6xx.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
cpu_setup_44x.S
cpu_setup_fsl_booke.S
cpu_setup_pa6t.S
cpu_setup_power.S
cpu_setup_ppc970.S
cputable.c Merge branch 'topic/ppc-kvm' into next 2018-07-19 14:37:57 +10:00
crash_dump.c
crash.c powerpc: remove kdump.h from page.h 2018-07-30 22:47:53 +10:00
dbell.c
dma-iommu.c
dma-swiotlb.c
dma.c PCI: Call dma_debug_add_bus() for pci_bus_type from PCI core 2018-07-30 15:58:01 -05:00
dt_cpu_ftrs.c Merge branch 'topic/ppc-kvm' into next 2018-07-19 14:37:57 +10:00
eeh_cache.c
eeh_dev.c
eeh_driver.c
eeh_event.c
eeh_pe.c
eeh_sysfs.c
eeh.c powerpc/eeh: Avoid misleading message "EEH: no capable adapters found" 2018-07-02 23:54:26 +10:00
entry_32.S powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms 2018-08-08 00:32:24 +10:00
entry_64.S powerpc/64s: Add support for software count cache flush 2018-08-08 00:32:26 +10:00
epapr_hcalls.S
epapr_paravirt.c
exceptions-64e.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
exceptions-64s.S KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds 2018-09-17 16:23:28 +10:00
fadump.c powerpc/fadump: cleanup crash memory ranges support 2018-08-20 20:19:54 +10:00
firmware.c
fpu.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
fsl_booke_entry_mapping.S
head_8xx.S powerpc: remove superflous inclusions of asm/fixmap.h 2018-07-30 22:48:18 +10:00
head_32.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
head_40x.S powerpc/405: move PPC405_ERR77 in asm-405.h 2018-07-30 22:48:13 +10:00
head_44x.S
head_64.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
head_booke.h
head_fsl_booke.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
hw_breakpoint.c perf/arch/powerpc: Implement hw_breakpoint_arch_parse() 2018-06-26 09:07:55 +02:00
idle_6xx.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
idle_book3e.S powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely 2018-07-24 22:03:14 +10:00
idle_book3s.S Merge branch 'fixes' into next 2018-08-13 15:59:06 +10:00
idle_e500.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
idle_power4.S powerpc/64s: Fix PACA_IRQ_HARD_DIS accounting in idle_power4() 2018-08-14 15:36:02 +10:00
idle.c
ima_kexec.c
io-workarounds.c
io.c
iomap.c
iommu.c
irq.c powerpc/64: Disable irq restore warning for now 2018-08-07 21:49:24 +10:00
isa-bridge.c
jump_label.c
kexec_elf_64.c
kgdb.c
kprobes-ftrace.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
kprobes.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
kvm_emul.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
kvm.c
l2cr_6xx.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
legacy_serial.c
machine_kexec_32.c
machine_kexec_64.c
machine_kexec_file_64.c powerpc/kexec: Use common error handling code in setup_new_fdt() 2018-08-10 22:12:36 +10:00
machine_kexec.c powerpc: remove kdump.h from page.h 2018-07-30 22:47:53 +10:00
Makefile powerpc/Makefiles: Convert ifeq to ifdef where possible 2018-08-08 00:32:36 +10:00
mce_power.c powerpc/64s: move machine check SLB flushing to mm/slb.c 2018-08-10 22:12:39 +10:00
mce.c
misc_32.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
misc_64.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
misc.S
module_32.c
module_64.c powerpc/kbuild: move -mprofile-kernel check to Kconfig 2018-06-11 09:16:29 +09:00
module.c powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC 2018-08-08 00:32:23 +10:00
module.lds
msi.c
nvram_64.c
of_platform.c
optprobes_head.S
optprobes.c
paca.c
pci_32.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
pci_64.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
pci_dn.c
pci_of_scan.c
pci-common.c powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
pci-hotplug.c
pmc.c
ppc32.h
ppc_save_regs.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
proc_powerpc.c
process.c powerpc: Add show_user_instructions() 2018-08-08 00:32:30 +10:00
prom_init_check.sh
prom_init.c powerpc: Move path variable inside DEBUG_PROM 2018-08-10 22:12:38 +10:00
prom_parse.c
prom.c powerpc: clean the inclusion of stringify.h 2018-07-30 22:48:17 +10:00
ptrace32.c
ptrace.c
reloc_32.S
reloc_64.S
rtas_flash.c
rtas_pci.c
rtas-proc.c
rtas-rtc.c
rtas.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
rtasd.c treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
security.c powerpc/64s: Add support for software count cache flush 2018-08-08 00:32:26 +10:00
setup_32.c powerpc/32: Include setup.h header file to fix warnings 2018-08-10 22:12:38 +10:00
setup_64.c powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
setup-common.c powerpc/64: Call setup_barrier_nospec() from setup_arch() 2018-08-08 00:32:23 +10:00
setup.h
signal_32.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
signal_64.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
signal.c rseq: Avoid infinite recursion when delivering SIGSEGV 2018-06-22 19:04:22 +02:00
signal.h
smp-tbsync.c
smp.c powerpc/topology: Get topology for shared processors at boot 2018-08-21 16:01:59 +10:00
stacktrace.c powerpc/64s: Fix build failures with CONFIG_NMI_IPI=n 2018-06-19 23:03:50 +10:00
suspend.c
swsusp_32.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
swsusp_64.c
swsusp_asm64.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
swsusp_booke.S
swsusp.c
sys_ppc32.c
syscalls.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
sysfs.c
systbl_chk.c
systbl_chk.sh
systbl.S
tau_6xx.c
time.c
tm.S powerpc/tm: Fix userspace r13 corruption 2018-09-25 22:51:08 +10:00
traps.c powerpc/traps: Avoid rate limit messages from show unhandled signals 2018-08-20 20:19:46 +10:00
udbg_16550.c
udbg.c
uprobes.c
vdso.c powerpc: remove unneeded inclusions of cpu_has_feature.h 2018-07-30 22:47:54 +10:00
vecemu.c
vector.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
vmlinux.lds.S powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC 2018-08-08 00:32:23 +10:00
watchdog.c powerpc: NMI IPI make NMI IPIs fully sychronous 2018-07-24 22:03:14 +10:00