[PATCH] powerpc/64s: fix hash page fault interrupt handler

Sachin Sant sachinp at linux.vnet.ibm.com
Tue Jun 29 14:56:55 AEST 2021



> On 29-Jun-2021, at 7:20 AM, Nicholas Piggin <npiggin at gmail.com> wrote:
> 
> The early bad fault or key fault test in do_hash_fault() ends up calling
> into ___do_page_fault without having gone through an interrupt handler
> wrapper (except the initial _RAW one). This can end up calling local irq
> functions while the interrupt has not been reconciled, which will likely
> cause crashes and it trips up on a later patch that adds more assertions.
> 
> pkey_exec_prot from selftests causes this path to be executed.
> 
> There is no real reason to run the in_nmi() test should be performed
> before the key fault check. In fact if a perf interrupt in the hash
> fault code did a stack walk that was made to take a key fault somehow
> then running ___do_page_fault could possibly cause another hash fault
> causing problems. Move the in_nmi() test first, and then do everything
> else inside the regular interrupt handler function.
> 
> Fixes: 3a96570ffceb ("powerpc: convert interrupt handlers to use wrappers")
> Reported-by: Sachin Sant <sachinp at linux.vnet.ibm.com>
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
> ---

Thanks Nick. 
Fixes the reported problem.

Tested-by: Sachin Sant <sachinp at linux.vnet.ibm.com>

-Sachin


More information about the Linuxppc-dev mailing list