Skip to content

Commit de9d7d9

Browse files
pb8oJonathanWoollett-Light
authored andcommitted
Update expected SPECTRE mitigations after RETbleed
Signed-off-by: Pablo Barbáchano <pablob@amazon.com>
1 parent 3c70571 commit de9d7d9

File tree

2 files changed

+5
-26
lines changed

2 files changed

+5
-26
lines changed

docs/prod-host-setup.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ echo "KSM: ENABLED (Recommendation: DISABLED)"
297297

298298
###### Intel and AMD
299299

300-
We recommend using a kernel compiled with eIBRS or `RETPOLINE`, together with
301-
microcode supporting conditional Indirect Branch Prediction Barriers (IBPB).
300+
We recommend using a kernel compiled with eIBRS or IBRS, together with microcode
301+
supporting conditional Indirect Branch Prediction Barriers (IBPB).
302302

303303
Verification can be done by running:
304304

@@ -308,7 +308,8 @@ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2
308308

309309
The output should mention the following mitigations being in use:
310310

311-
- `Enhanced IBRS` or `Retpolines`
311+
- One of Retpolines (pre-Skylake CPU), IBRS (Skylake), or Enhanced IBRS (Cascade
312+
Lake and later)
312313
- `IBPB` at least `conditional`
313314

314315
###### ARM64

tests/conftest.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def test_with_any_microvm(test_microvm_any):
8686
import tempfile
8787
import uuid
8888
import json
89-
import re
9089

9190
import pytest
9291

@@ -485,30 +484,9 @@ def test_multiple_microvms(test_fc_session_root_path, context, bin_cloner_path):
485484
def test_spectre_mitigations():
486485
"""Check the kernel is compiled with SPECTREv2 mitigations."""
487486

488-
def check_retpoline(body):
489-
# We check for full retpoline support by checking if the kernel was:
490-
# 1. compiled with CONFIG_RETPOLINE
491-
# 2. built with a retpoline-capable compiler
492-
493-
_, stdout, _ = utils.run_cmd("uname -r")
494-
opt_config = "/boot/config-{}".format(stdout.rstrip())
495-
assert os.path.exists(opt_config)
496-
code, _, _ = utils.run_cmd(
497-
"grep -q '^CONFIG_RETPOLINE' {}".format(opt_config), ignore_return_code=True
498-
)
499-
if code != 0:
500-
return False
501-
502-
# As per the spectre-meltdown-checker, if retpoline or retpolines exist as
503-
# whole words and minimial is not found, then it's full retpoline.
504-
words = re.split(" |; |, |: |\n", body)
505-
if ("retpoline" in words or "retpolines" in words) and "minimal" not in words:
506-
return True
507-
return False
508-
509487
def x86_64(body):
510488
return ("IBPB: conditional" in body or "IBPB: always-on" in body) and (
511-
"Enhanced IBRS" in body or check_retpoline(body.lower())
489+
"Enhanced IBRS" in body or "IBRS" in body
512490
)
513491

514492
def aarch64(body):

0 commit comments

Comments
 (0)