This is a note to let you know that I've just added the patch titled powerpc/64s/interrupt: Fix check_return_regs_valid() false positive to the 5.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: powerpc-64s-interrupt-fix-check_return_regs_valid-false-positive.patch and it can be found in the queue-5.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4a5cb51f3db4be547225a4bce7a43d41b231382b Mon Sep 17 00:00:00 2001 From: Nicholas Piggin <npiggin@xxxxxxxxx> Date: Tue, 26 Oct 2021 22:25:31 +1000 Subject: powerpc/64s/interrupt: Fix check_return_regs_valid() false positive From: Nicholas Piggin <npiggin@xxxxxxxxx> commit 4a5cb51f3db4be547225a4bce7a43d41b231382b upstream. The check_return_regs_valid() can cause a false positive if the return regs are marked as norestart and they are an HSRR type interrupt, because the low bit in the bottom of regs->trap causes interrupt type matching to fail. This can occcur for example on bare metal with a HV privileged doorbell interrupt that causes a signal, but do_signal returns early because get_signal() fails, and takes the "No signal to deliver" path. In this case no signal was delivered so the return location is not changed so return SRRs are not invalidated, yet set_trap_norestart is called, which messes up the match. Building go-1.16.6 is known to reproduce this. Fix it by using the TRAP() accessor which masks out the low bit. Fixes: 6eaaf9de3599 ("powerpc/64s/interrupt: Check and fix srr_valid without crashing") Cc: stable@xxxxxxxxxxxxxxx # v5.14+ Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx> Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20211026122531.3599918-1-npiggin@xxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/powerpc/kernel/interrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/kernel/interrupt.c +++ b/arch/powerpc/kernel/interrupt.c @@ -268,7 +268,7 @@ static void check_return_regs_valid(stru if (trap_is_scv(regs)) return; - trap = regs->trap; + trap = TRAP(regs); // EE in HV mode sets HSRRs like 0xea0 if (cpu_has_feature(CPU_FTR_HVMODE) && trap == INTERRUPT_EXTERNAL) trap = 0xea0; Patches currently in stable-queue which might be from npiggin@xxxxxxxxx are queue-5.14/powerpc-32e-ignore-esr-in-instruction-storage-interrupt-handler.patch queue-5.14/powerpc-64s-interrupt-fix-check_return_regs_valid-false-positive.patch queue-5.14/ftrace-do-cpu-checking-after-preemption-disabled.patch queue-5.14/powerpc-security-use-a-mutex-for-interrupt-exit-code-patching.patch queue-5.14/kvm-ppc-tick-accounting-should-defer-vtime-accounting-til-after-irq-handling.patch