From 619b2749d81ae2c300cde5e0925dad31b06e3643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 3 Apr 2018 19:32:36 +0200 Subject: [PATCH] fix(sysfs): only check for sysfs for spectre2 when in live mode --- spectre-meltdown-checker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index af3e4b0..737a322 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -2016,7 +2016,7 @@ check_variant2_linux() # See gcc commit https://github.com/hjl-tools/gcc/commit/23b517d4a67c02d3ef80b6109218f2aadad7bd79 # In latest retpoline LKML patches, the noretpoline_setup symbol exists only if CONFIG_RETPOLINE is set # *AND* if the compiler is retpoline-compliant, so look for that symbol - if [ -e "/sys/devices/system/cpu/vulnerabilities/spectre_v2" ]; then + if [ "$opt_live" = 1 ] && [ -e "/sys/devices/system/cpu/vulnerabilities/spectre_v2" ]; then if grep -qw Minimal /sys/devices/system/cpu/vulnerabilities/spectre_v2; then pstatus yellow NO "kernel reports minimal retpoline compilation" elif grep -qw Full /sys/devices/system/cpu/vulnerabilities/spectre_v2; then