powerpc/64e: Clear gprs on interrupt routine entry on Book3E
authorRohan McLure <rmclure@linux.ibm.com>
Thu, 1 Dec 2022 07:10:18 +0000 (18:10 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 09:46:08 +0000 (20:46 +1100)
commitefe1691ac814e4cf3653538b701662cbd905bddc
tree57891587f077e10214fa75f0f6bad13ee35e895f
parent1df45d78b8a89da6544fab5267e8f5da15073d28
powerpc/64e: Clear gprs on interrupt routine entry on Book3E

Zero GPRS r14-r31 on entry into the kernel for interrupt sources to
limit influence of user-space values in potential speculation gadgets.
Prior to this commit, all other GPRS are reassigned during the common
prologue to interrupt handlers and so need not be zeroised explicitly.

This may be done safely, without loss of register state prior to the
interrupt, as the common prologue saves the initial values of
non-volatiles, which are unconditionally restored in interrupt_64.S.
Mitigation defaults to enabled by INTERRUPT_SANITIZE_REGISTERS.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221201071019.1953023-6-rmclure@linux.ibm.com
arch/powerpc/kernel/exceptions-64e.S