aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xspectre-meltdown-checker.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh
index e0a5bb5..2eb4531 100755
--- a/spectre-meltdown-checker.sh
+++ b/spectre-meltdown-checker.sh
@@ -186,7 +186,11 @@ if [ "$opt_live" = 1 ]; then
[ -e /boot/kernel-genkernel-$(uname -m)-$(uname -r) ] && opt_kernel=/boot/kernel-genkernel-$(uname -m)-$(uname -r)
# system.map
- [ -e /boot/System.map-$(uname -r) ] && opt_map=/boot/System.map-$(uname -r)
+ if [ -e /proc/kallsyms ] ; then
+ opt_map="/proc/kallsyms"
+ elif [ -e /boot/System.map-$(uname -r) ] ; then
+ opt_map=/boot/System.map-$(uname -r)
+ fi
# config
if [ -e /proc/config.gz ] ; then
@@ -236,7 +240,7 @@ fi
###########
# SPECTRE 1
/bin/echo -e "\033[1;34mCVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'\033[0m"
-/bin/echo -n "* Kernel compiled with LFENCE opcode inserted at the proper places: "
+/bin/echo -n "* Checking count of LFENCE opcodes in kernel: "
status=0
if [ -n "$vmlinux_err" ]; then
@@ -264,8 +268,8 @@ fi
/bin/echo -ne "> \033[46m\033[30mSTATUS:\033[0m "
[ "$status" = 0 ] && pstatus yellow UNKNOWN
-[ "$status" = 1 ] && pstatus red VULNERABLE
-[ "$status" = 2 ] && pstatus green 'NOT VULNERABLE'
+[ "$status" = 1 ] && pstatus red 'VULNERABLE' 'heuristic to be improved when official patches become available'
+[ "$status" = 2 ] && pstatus green 'NOT VULNERABLE' 'heuristic to be improved when official patches become available'
###########
# VARIANT 2
@@ -314,7 +318,7 @@ if [ "$opt_live" = 1 ]; then
ibrs_enabled=$(cat /sys/kernel/debug/x86/ibrs_enabled 2>/dev/null)
fi
fi
-if [ "$ibrs_supported " != 1 -a -n "$opt_map" ]; then
+if [ "$ibrs_supported" != 1 -a -n "$opt_map" ]; then
if grep -q spec_ctrl "$opt_map"; then
pstatus green YES
ibrs_supported=1