selftests/powerpc: Add test of mitigation patching
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 7 May 2021 06:42:25 +0000 (16:42 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 17 May 2021 05:27:47 +0000 (15:27 +1000)
commit34f7f79827ec4db30cff9001dfba19f496473e8d
tree413b5e683c44bffdf055f3078b2d7f00ddfd811b
parentca8cc36901e9bdd01d371f6236faf9f61d1325d1
selftests/powerpc: Add test of mitigation patching

We recently discovered some of our mitigation patching was not safe
against other CPUs running concurrently.

Add a test which enable/disables all mitigations in a tight loop while
also running some stress load. On an unpatched system this almost always
leads to an oops and panic/reboot, but we also check if the kernel
becomes tainted in case we have a non-fatal oops.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210507064225.1556312-1-mpe@ellerman.id.au
tools/testing/selftests/powerpc/security/Makefile
tools/testing/selftests/powerpc/security/mitigation-patching.sh [new file with mode: 0755]