mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2025-07-15 07:11:22 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
05c79425ab | |||
9def0c949a | |||
64eb1d005c |
24
README.md
24
README.md
@ -28,24 +28,24 @@ Example of the output of the script:
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ sudo ./spectre-meltdown-checker.sh
|
$ sudo ./spectre-meltdown-checker.sh
|
||||||
Spectre and Meltdown mitigation detection tool v0.02
|
Spectre and Meltdown mitigation detection tool v0.07
|
||||||
|
|
||||||
CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
|
CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
|
||||||
* Kernel compiled with LFENCE opcode inserted at the proper places: NO (only 38 opcodes found, should be >= 60)
|
* Kernel compiled with LFENCE opcode inserted at the proper places: NO (only 38 opcodes found, should be >= 60)
|
||||||
> STATUS: VULNERABLE
|
> STATUS: VULNERABLE
|
||||||
|
|
||||||
CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
|
CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
|
||||||
* Mitigation 1
|
* Mitigation 1
|
||||||
* Hardware (CPU microcode) support for mitigation: NO
|
* Hardware (CPU microcode) support for mitigation: NO
|
||||||
* Kernel support for IBRS: NO
|
* Kernel support for IBRS: NO
|
||||||
* IBRS enabled for Kernel space: NO
|
* IBRS enabled for Kernel space: NO
|
||||||
* IBRS enabled for User space: NO
|
* IBRS enabled for User space: NO
|
||||||
* Mitigation 2
|
* Mitigation 2
|
||||||
* Kernel recompiled with retpolines: UNKNOWN (check not yet implemented)
|
* Kernel compiled with retpolines: NO
|
||||||
> STATUS: VULNERABLE (IBRS hardware + kernel support OR retpolines-compiled kernel are needed to mitigate the vulnerability)
|
> STATUS: VULNERABLE (IBRS hardware + kernel support OR kernel with retpolines are needed to mitigate the vulnerability)
|
||||||
|
|
||||||
CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
|
CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
|
||||||
* Kernel supports Page Table Isolation (PTI): YES
|
* Kernel supports Page Table Isolation (PTI): YES
|
||||||
* PTI enabled and active: YES
|
* PTI enabled and active: YES
|
||||||
> STATUS: NOT VULNERABLE (PTI mitigates the vulnerability)
|
> STATUS: NOT VULNERABLE (PTI mitigates the vulnerability)
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Spectre & Meltdown checker
|
# Spectre & Meltdown checker
|
||||||
# Stephane Lesimple
|
# Stephane Lesimple
|
||||||
VERSION=0.06
|
VERSION=0.08
|
||||||
|
|
||||||
pstatus()
|
pstatus()
|
||||||
{
|
{
|
||||||
@ -95,7 +95,6 @@ else
|
|||||||
pstatus green YES "$nb_lfence opcodes found, which is >= 60"
|
pstatus green YES "$nb_lfence opcodes found, which is >= 60"
|
||||||
status=2
|
status=2
|
||||||
fi
|
fi
|
||||||
rm -f $vmlinux
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -178,6 +177,8 @@ elif [ -e /boot/config-$(uname -r) ]; then
|
|||||||
else
|
else
|
||||||
pstatus red NO
|
pstatus red NO
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
pstatus yellow UNKNOWN "couldn't read your kernel configuration"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/bin/echo -ne "> \033[46m\033[30mSTATUS:\033[0m "
|
/bin/echo -ne "> \033[46m\033[30mSTATUS:\033[0m "
|
||||||
@ -216,15 +217,23 @@ elif [ -e /boot/System.map-$(uname -r) ]; then
|
|||||||
else
|
else
|
||||||
pstatus red NO
|
pstatus red NO
|
||||||
fi
|
fi
|
||||||
|
elif [ -n "$vmlinux" ]; then
|
||||||
|
# some backports don't have the option but still have the patch, try to find out
|
||||||
|
if strings "$vmlinux" | grep -qw nopti; then
|
||||||
|
pstatus green YES
|
||||||
|
kpti_support=1
|
||||||
|
else
|
||||||
|
pstatus red NO
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
pstatus yellow UNKNOWN
|
pstatus yellow UNKNOWN "couldn't read your kernel configuration"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/bin/echo -n "* PTI enabled and active: "
|
/bin/echo -n "* PTI enabled and active: "
|
||||||
if grep ^flags /proc/cpuinfo | grep -qw pti; then
|
if grep ^flags /proc/cpuinfo | grep -qw pti; then
|
||||||
pstatus green YES
|
pstatus green YES
|
||||||
kpti_enabled=1
|
kpti_enabled=1
|
||||||
elif dmesg | grep -q 'Kernel/User page tables isolation: enabled'; then
|
elif dmesg | grep -Eq 'Kernel/User page tables isolation: enabled|Kernel page table isolation enabled'; then
|
||||||
pstatus green YES
|
pstatus green YES
|
||||||
kpti_enabled=1
|
kpti_enabled=1
|
||||||
else
|
else
|
||||||
@ -247,3 +256,5 @@ if [ "$USER" != root ]; then
|
|||||||
/bin/echo "You can try the following command: sudo $0"
|
/bin/echo "You can try the following command: sudo $0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -n "$vmlinux" ] && rm -f "$vmlinux"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user