[PATCH kernel v2] powerpc/kuap: Restore AMR after replaying soft interrupts
Aneesh Kumar K.V
aneesh.kumar at linux.ibm.com
Thu Dec 3 17:38:03 AEDT 2020
Alexey Kardashevskiy <aik at ozlabs.ru> writes:
> When interrupted in raw_copy_from_user()/... after user memory access
> is enabled, a nested handler may also access user memory (perf is
> one example) and when it does so, it calls prevent_read_from_user()
> which prevents the upper handler from accessing user memory.
>
> This saves/restores AMR when replaying interrupts.
>
> get_kuap/set_kuap have stubs for disabled KUAP on RADIX but there are
> none for hash-only configs (BOOK3E) so this adds stubs and moves
> AMR_KUAP_BLOCK_xxx.
>
> Found by syzkaller. More likely to break with enabled
> CONFIG_DEBUG_ATOMIC_SLEEP, the call chain is
> timer_interrupt -> ktime_get -> read_seqcount_begin -> local_irq_restore.
Can you test this with https://github.com/kvaneesh/linux/commits/hash-kuap-reworked-2
We do save restore AMR on interrupt entry and exit.
-aneesh
More information about the Linuxppc-dev
mailing list