mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2025-07-15 15:21:23 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
12bdd0e412 | |||
89f9bef577 | |||
bf056ae73d | |||
623e180ae1 | |||
40a9d43c44 |
@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# Spectre & Meltdown checker
|
||||
# Stephane Lesimple
|
||||
VERSION=0.10
|
||||
VERSION=0.11
|
||||
|
||||
# print status function
|
||||
pstatus()
|
||||
@ -78,9 +78,18 @@ extract_vmlinux()
|
||||
|
||||
# end of extract-vmlinux functions
|
||||
|
||||
/bin/echo "Spectre and Meltdown mitigation detection tool v$VERSION"
|
||||
/bin/echo -e "\033[1;34mSpectre and Meltdown mitigation detection tool v$VERSION\033[0m"
|
||||
/bin/echo
|
||||
|
||||
# root check
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
/bin/echo -e "\033[31mNote that you should launch this script with root privileges to get accurate information."
|
||||
/bin/echo -e "\033[31mWe'll proceed but you might see permission denied errors."
|
||||
/bin/echo -e "\033[31mTo run it as root, you can try the following command: sudo $0"
|
||||
/bin/echo
|
||||
fi
|
||||
|
||||
###########
|
||||
# SPECTRE 1
|
||||
/bin/echo -e "\033[1;34mCVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'\033[0m"
|
||||
@ -89,10 +98,11 @@ extract_vmlinux()
|
||||
status=0
|
||||
img=''
|
||||
# try to find the image of the current running kernel
|
||||
[ -e /boot/vmlinuz-linux ] && img=/boot/vmlinuz-linux
|
||||
[ -e /boot/vmlinuz-$(uname -r) ] && img=/boot/vmlinuz-$(uname -r)
|
||||
[ -e /boot/vmlinux-$(uname -r) ] && img=/boot/vmlinux-$(uname -r)
|
||||
[ -e /boot/kernel-$( uname -r) ] && img=/boot/kernel-$( uname -r)
|
||||
[ -e /boot/bzImage-$(uname -r) ] && img=/boot/bzImage-$(uname -r)
|
||||
[ -e /boot/kernel-genkernel-$(uname -m)-$(uname -r) ] && img=/boot/kernel-genkernel-$(uname -m)-$(uname -r)
|
||||
if [ -z "$img" ]; then
|
||||
pstatus yellow UNKNOWN "couldn't find your kernel image in /boot, if you used netboot, this is normal"
|
||||
else
|
||||
@ -292,9 +302,5 @@ else
|
||||
fi
|
||||
|
||||
/bin/echo
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
/bin/echo "Note that you should launch this script with root privileges to get accurate information"
|
||||
/bin/echo "You can try the following command: sudo $0"
|
||||
fi
|
||||
|
||||
[ -n "$vmlinux" -a -f "$vmlinux" ] && rm -f "$vmlinux"
|
||||
|
Reference in New Issue
Block a user