On Wed, 15 Sep 2021 16:12:24 +0200, Christophe Leroy wrote: > At interrupt exit, kuap_kernel_restore() calls kuap_unclok() with the > value contained in regs->kuap. However, when regs->kuap contains > 0xffffffff it means that KUAP was not unlocked so calling > kuap_unlock() is unrelevant and results in jeopardising the contents > of kernel space segment registers. > > So check that regs->kuap doesn't contain KUAP_NONE before calling > kuap_unlock(). In the meantime it also means that if KUAP has not > been correcly locked back at interrupt exit, it must be locked > before continuing. This is done by checking the content of > current->thread.kuap which was returned by kuap_get_and_assert_locked() > > [...]
Applied to powerpc/fixes. [1/1] powerpc/32s: Fix kuap_kernel_restore() https://git.kernel.org/powerpc/c/d93f9e23744b7bf11a98b2ddb091d129482ae179 cheers