From f191ec788451f470851a0259a761e35f5dbf8eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Sun, 25 Mar 2018 12:48:37 +0200 Subject: [PATCH] feat: add --hw-only to only show CPU microcode/cpuid/msr details --- spectre-meltdown-checker.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index e2792ec..b13a228 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -64,6 +64,7 @@ show_usage() --variant [1,2,3] specify which variant you'd like to check, by default all variants are checked, can be specified multiple times (e.g. --variant 2 --variant 3) + --hw-only only check for CPU informations, don't check for any variant Return codes: 0 (not vulnerable), 2 (vulnerable), 3 (unknown), 255 (error) @@ -125,6 +126,7 @@ opt_no_sysfs=0 opt_sysfs_only=0 opt_coreos=0 opt_arch_prefix='' +opt_hw_only=0 global_critical=0 global_unknown=0 @@ -445,6 +447,9 @@ while [ -n "$1" ]; do # don't use directly: used internally by --coreos opt_coreos=0 shift + elif [ "$1" = "--hw-only" ]; then + opt_hw_only=1 + shift elif [ "$1" = "--batch" ]; then opt_batch=1 opt_verbose=0 @@ -1013,6 +1018,18 @@ if [ "$opt_live_explicit" = 1 ]; then exit 255 fi fi +if [ "$opt_hw_only" = 1 ]; then + if [ "$opt_allvariants" = 0 ]; then + show_usage + echo "$0: error: incompatible modes specified, --hw-only vs --variant" >&2 + exit 255 + else + opt_allvariants=0 + opt_variant1=0 + opt_variant2=0 + opt_variant3=0 + fi +fi # coreos mode if [ "$opt_coreos" = 1 ]; then