mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2025-07-15 15:21:23 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
64eb1d005c | |||
bffda8b3e7 | |||
13f2133a97 | |||
8c2fd0f0bb | |||
761c2b80e4 | |||
d6977928e5 |
@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# Spectre & Meltdown checker
|
||||
# Stephane Lesimple
|
||||
VERSION=0.04
|
||||
VERSION=0.07
|
||||
|
||||
pstatus()
|
||||
{
|
||||
@ -116,14 +116,13 @@ fi
|
||||
if [ ! -e /dev/cpu/0/msr ]; then
|
||||
pstatus yellow UNKNOWN "couldn't read /dev/cpu/0/msr, is msr support enabled in your kernel?"
|
||||
else
|
||||
dd if=/dev/cpu/0/msr of=/dev/null bs=1 count=8 skip=72 2>/dev/null
|
||||
# same that rdmsr 0x48 but without needing the rdmsr tool
|
||||
dd if=/dev/cpu/0/msr of=/dev/null bs=8 count=1 skip=9 2>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
pstatus green YES
|
||||
else
|
||||
pstatus red NO
|
||||
fi
|
||||
#dd if=/dev/cpu/0/msr of=/dev/null bs=1 count=8 skip=73 2>/dev/null
|
||||
#/bin/echo $?
|
||||
fi
|
||||
|
||||
if [ "$insmod_msr" = 1 ]; then
|
||||
@ -163,7 +162,7 @@ if [ "$mounted_debugfs" = 1 ]; then
|
||||
fi
|
||||
|
||||
/bin/echo "* Mitigation 2"
|
||||
/bin/echo -n "* Kernel recompiled with retpolines: "
|
||||
/bin/echo -n "* Kernel compiled with retpolines: "
|
||||
# XXX this doesn't mean the kernel has been compiled with a retpoline-aware gcc
|
||||
if [ -e /proc/config.gz ]; then
|
||||
if zgrep -q '^CONFIG_RETPOLINE=y' /proc/config.gz; then
|
||||
@ -179,6 +178,8 @@ elif [ -e /boot/config-$(uname -r) ]; then
|
||||
else
|
||||
pstatus red NO
|
||||
fi
|
||||
else
|
||||
pstatus yellow UNKNOWN "couldn't read your kernel configuration"
|
||||
fi
|
||||
|
||||
/bin/echo -ne "> \033[46m\033[30mSTATUS:\033[0m "
|
||||
@ -189,7 +190,7 @@ elif [ "$ibrs_enabled" = 1 -o "$ibrs_enabled" = 2 ]; then
|
||||
elif [ "$retpoline" = 1 ]; then
|
||||
pstatus green "NOT VULNERABLE" "retpolines mitigate the vulnerability"
|
||||
else
|
||||
pstatus red VULNERABLE "IBRS hardware + kernel support OR kernel with retpolines kernel are needed to mitigate the vulnerability"
|
||||
pstatus red VULNERABLE "IBRS hardware + kernel support OR kernel with retpolines are needed to mitigate the vulnerability"
|
||||
fi
|
||||
|
||||
# MELTDOWN
|
||||
@ -218,7 +219,7 @@ elif [ -e /boot/System.map-$(uname -r) ]; then
|
||||
pstatus red NO
|
||||
fi
|
||||
else
|
||||
pstatus yellow UNKNOWN
|
||||
pstatus yellow UNKNOWN "couldn't read your kernel configuration"
|
||||
fi
|
||||
|
||||
/bin/echo -n "* PTI enabled and active: "
|
||||
|
Reference in New Issue
Block a user