From 31146550a38e3ccd19bb5faee63074673b26682b Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Sun, 8 Apr 2018 21:13:59 +0200 Subject: [PATCH 1/2] Fixes #175: Make it overly obvious that this tool only checks the kernel; --- 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 8ff056d..26f03ad 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -590,7 +590,7 @@ pvulnstatus() # display info if we're not in quiet/batch mode vulnstatus="$2" shift 2 - _info_nol "> \033[46m\033[30mSTATUS:\033[0m " + _info_nol "> \033[46m\033[30mKERNEL STATUS:\033[0m " case "$vulnstatus" in UNK) pstatus yellow 'UNKNOWN' "$@";; VULN) pstatus red 'VULNERABLE' "$@";; From a6f446b15fe9a7474a8293158217891a14ff9c12 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Sun, 8 Apr 2018 21:14:18 +0200 Subject: [PATCH 2/2] Fix trailing whitespace and mixed indent styles; --- spectre-meltdown-checker.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index 26f03ad..fc98868 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -1304,7 +1304,7 @@ number_of_cpus() } # $1 - msr number -# $2 - cpu index +# $2 - cpu index write_msr() { if [ "$os" != Linux ]; then @@ -1384,7 +1384,7 @@ check_cpu() val=0 cpu_mismatch=0 for i in $(seq 0 "$idx_max_cpu") - do + do read_msr 0x48 "$i"; ret=$? if [ "$i" -eq 0 ]; then val=$ret @@ -1454,7 +1454,7 @@ check_cpu() val=0 cpu_mismatch=0 for i in $(seq 0 "$idx_max_cpu") - do + do write_msr 0x49 "$i"; ret=$? if [ "$i" -eq 0 ]; then val=$ret @@ -1550,7 +1550,7 @@ check_cpu() val_cap_msr=0 cpu_mismatch=0 for i in $(seq 0 "$idx_max_cpu") - do + do read_msr 0x10a "$i"; ret=$? capabilities=$(echo "$read_msr_value" | awk '{print $8}') if [ "$i" -eq 0 ]; then @@ -2017,7 +2017,7 @@ check_variant2_linux() else pstatus yellow NO if [ -e "$specex_knob_dir/ibrs_enabled" ]; then - _verbose " - To enable, \`echo 1 > $specex_knob_dir/ibrs_enabled' as root. If you don't have hardware support, you'll get an error." + _verbose " - To enable, \`echo 1 > $specex_knob_dir/ibrs_enabled' as root. If you don't have hardware support, you'll get an error." fi fi ;;