From 37ce03288883829902782d9c1117ce53e2159467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Sat, 17 Mar 2018 16:13:37 +0100 Subject: [PATCH] fix: bypass MSR/CPUID checks for non-x86 CPUs --- spectre-meltdown-checker.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index 9efac28..db681fc 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -1126,6 +1126,10 @@ check_cpu() { _info "\033[1;34mHardware check\033[0m" + if ! uname -m | grep -qwE 'x86_64|i[3-6]86'; then + return + fi + _info "* Hardware support (CPU microcode) for mitigation techniques" _info " * Indirect Branch Restricted Speculation (IBRS)" _info_nol " * SPEC_CTRL MSR is available: " @@ -1369,7 +1373,10 @@ check_cpu() else pstatus blue NO "$ucode_found" fi +} +check_cpu_vulnerabilities() +{ _info "* CPU vulnerability to the three speculative execution attacks variants" for v in 1 2 3; do _info_nol " * Vulnerable to Variant $v: " @@ -1379,8 +1386,6 @@ check_cpu() pstatus green NO fi done - - _info } check_redhat_canonical_spectre() @@ -2024,6 +2029,9 @@ check_variant3() } check_cpu +check_cpu_vulnerabilities +_info + # now run the checks the user asked for if [ "$opt_variant1" = 1 ] || [ "$opt_allvariants" = 1 ]; then check_variant1