]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Fix stf mitigation patching w/strict RWX & hash
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 13 May 2021 14:08:00 +0000 (00:08 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 14 May 2021 07:27:37 +0000 (17:27 +1000)
commit18b20728afd4a5a25e6e5223369ea03d9e433a75
treee87e6b90e7fa12a56f765b7cd181939ecaad1d6b
parent9d736542f6f5b1b74fdb7e828fa907bf4c14f582
powerpc/64s: Fix stf mitigation patching w/strict RWX & hash

The stf entry barrier fallback is unsafe to execute in a semi-patched
state, which can happen when enabling/disabling the mitigation with
strict kernel RWX enabled and using the hash MMU.

See the previous commit for more details.

Fix it by changing the order in which we patch the instructions.

Note the stf barrier fallback is only used on Power6 or earlier.

Fixes: 527993a0b94e ("powerpc/mm/64s: Allow STRICT_KERNEL_RWX again")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210513140800.1391706-2-mpe@ellerman.id.au
arch/powerpc/lib/feature-fixups.c