mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2025-07-15 15:21:23 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
8c2fd0f0bb | |||
761c2b80e4 | |||
d6977928e5 |
@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Spectre & Meltdown checker
|
# Spectre & Meltdown checker
|
||||||
# Stephane Lesimple
|
# Stephane Lesimple
|
||||||
VERSION=0.04
|
VERSION=0.05
|
||||||
|
|
||||||
pstatus()
|
pstatus()
|
||||||
{
|
{
|
||||||
@ -11,7 +11,7 @@ pstatus()
|
|||||||
yellow) col="\033[103m\033[30m";;
|
yellow) col="\033[103m\033[30m";;
|
||||||
*) col="";;
|
*) col="";;
|
||||||
esac
|
esac
|
||||||
/bin/echo -ne "$col$2\033[0m"
|
/bin/echo -ne "$col $2 \033[0m"
|
||||||
[ -n "$3" ] && /bin/echo -n " ($3)"
|
[ -n "$3" ] && /bin/echo -n " ($3)"
|
||||||
/bin/echo
|
/bin/echo
|
||||||
}
|
}
|
||||||
@ -116,14 +116,23 @@ fi
|
|||||||
if [ ! -e /dev/cpu/0/msr ]; then
|
if [ ! -e /dev/cpu/0/msr ]; then
|
||||||
pstatus yellow UNKNOWN "couldn't read /dev/cpu/0/msr, is msr support enabled in your kernel?"
|
pstatus yellow UNKNOWN "couldn't read /dev/cpu/0/msr, is msr support enabled in your kernel?"
|
||||||
else
|
else
|
||||||
dd if=/dev/cpu/0/msr of=/dev/null bs=1 count=8 skip=72 2>/dev/null
|
if which rdmsr >/dev/null 2>&1; then
|
||||||
if [ $? -eq 0 ]; then
|
rdmsr 0x48 >/dev/null 2>&1
|
||||||
pstatus green YES
|
if [ $? -eq 0 ]; then
|
||||||
|
pstatus green YES
|
||||||
|
else
|
||||||
|
pstatus red NO
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
pstatus red NO
|
pstatus yellow UNKNOWN "missing 'rdmsr' tool, please install it, usually it's in the msr-tools package"
|
||||||
|
# doesn't work:
|
||||||
|
#dd if=/dev/cpu/0/msr of=/dev/null bs=1 count=8 skip=72 2>/dev/null
|
||||||
|
#if [ $? -eq 0 ]; then
|
||||||
|
# pstatus green YES
|
||||||
|
#else
|
||||||
|
# pstatus red NO
|
||||||
|
#fi
|
||||||
fi
|
fi
|
||||||
#dd if=/dev/cpu/0/msr of=/dev/null bs=1 count=8 skip=73 2>/dev/null
|
|
||||||
#/bin/echo $?
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$insmod_msr" = 1 ]; then
|
if [ "$insmod_msr" = 1 ]; then
|
||||||
@ -189,7 +198,7 @@ elif [ "$ibrs_enabled" = 1 -o "$ibrs_enabled" = 2 ]; then
|
|||||||
elif [ "$retpoline" = 1 ]; then
|
elif [ "$retpoline" = 1 ]; then
|
||||||
pstatus green "NOT VULNERABLE" "retpolines mitigate the vulnerability"
|
pstatus green "NOT VULNERABLE" "retpolines mitigate the vulnerability"
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
# MELTDOWN
|
# MELTDOWN
|
||||||
|
Reference in New Issue
Block a user