Nicholas Piggin 4a5cb51f3d powerpc/64s/interrupt: Fix check_return_regs_valid() false positive
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@vger.kernel.org # v5.14+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211026122531.3599918-1-npiggin@gmail.com
2021-10-27 22:33:47 +11:00
..
2021-04-30 12:22:28 -07:00
2021-09-03 22:54:12 +10:00
2020-08-07 18:48:15 -07:00
2021-10-13 16:45:33 +11:00
2021-09-03 11:22:50 -07:00
2020-12-04 01:01:09 +11:00
2021-09-03 11:22:50 -07:00
2021-04-30 11:20:40 -07:00
2021-09-03 15:33:47 -07:00
2021-09-03 15:33:47 -07:00
2021-08-19 09:02:55 +09:00
2021-02-09 00:10:50 +11:00
2021-08-19 09:02:55 +09:00