linux-stable/arch/powerpc
Nicholas Piggin 2ea31e2e62 powerpc/64s/interrupt: Fix interrupt exit race with security mitigation switch
The RFI and STF security mitigation options can flip the
interrupt_exit_not_reentrant static branch condition concurrently with
the interrupt exit code which tests that branch.

Interrupt exit tests this condition to set MSR[EE|RI] for exit, then
again in the case a soft-masked interrupt is found pending, to recover
the MSR so the interrupt can be replayed before attempting to exit
again. If the condition changes between these two tests, the MSR and irq
soft-mask state will become corrupted, leading to warnings and possible
crashes. For example, if the branch is initially true then false,
MSR[EE] will be 0 but PACA_IRQ_HARD_DIS clear and EE may not get
enabled, leading to warnings in irq_64.c.

Fixes: 13799748b9 ("powerpc/64: use interrupt restart table to speed up return from interrupt")
Cc: stable@vger.kernel.org # v5.14+
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230206042240.92103-1-npiggin@gmail.com
2023-02-07 10:13:33 +11:00
..
boot powerpc/boot: Fix incorrect version calculation issue in ld_version 2023-01-11 16:28:43 +11:00
configs USB/Thunderbolt driver changes for 6.2-rc1 2022-12-16 03:22:53 -08:00
crypto treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
include powerpc/64s: Reconnect tlb_flush() to hash__tlb_flush() 2023-02-02 13:25:47 +11:00
kernel powerpc/64s/interrupt: Fix interrupt exit race with security mitigation switch 2023-02-07 10:13:33 +11:00
kexec powerpc/kexec_file: fix implicit decl error 2023-02-06 22:00:30 +11:00
kvm powerpc/kvm: Fix unannotated intra-function call warning 2023-01-30 16:01:04 +11:00
lib powerpc/code-patching: Fix oops with DEBUG_VM enabled 2022-12-16 23:59:43 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/64s/radix: Fix RWX mapping with relocated kernel 2023-01-31 21:37:39 +11:00
net powerpc/bpf/32: Fix Oops on tail call tests 2022-11-24 23:05:10 +11:00
perf powerpc/imc-pmu: Revert nest_init_lock to being a mutex 2023-01-31 11:24:17 +11:00
platforms powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
purgatory powerpc/purgatory: Omit use of bin2c 2022-07-27 21:36:03 +10:00
sysdev powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
tools powerpc/64: Add UADDR64 relocation support 2022-03-09 21:47:53 +11:00
xmon powerpc: Rename STACK_FRAME_MARKER and derive it from frame offset 2022-12-02 17:54:08 +11:00
Kbuild
Kconfig powerpc: Don't select ARCH_WANTS_NO_INSTR 2023-02-02 21:27:35 +11:00
Kconfig.debug powerpc: Add support for early debugging via Serial 16550 console 2022-09-28 19:22:09 +10:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Makefile.postlink