test_speculation_ctrl will fail on some systems
catern opened this issue · comments
test_speculation_ctrl calls prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_ENABLE)
, but when running on a kernel where someone has previously called prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_FORCE_DISABLE)
, this will always fail.
We ran into this in the Nix package, where we need to disable this test to build reliably: NixOS/nixpkgs#106875
Maybe the test should call PR_GET_SPECULATION_CTRL first and check if it's PR_SPEC_FORCE_DISABLE, and skip the ENABLE if so?