mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2025-07-15 23:31:22 +02:00
Compare commits
211 Commits
Author | SHA1 | Date | |
---|---|---|---|
edebe4dcd4 | |||
83ea78f523 | |||
602b68d493 | |||
97bccaa0d7 | |||
68e619b0d3 | |||
a6f4475cee | |||
223f5028df | |||
c0108b9690 | |||
a3016134bd | |||
59d85b39c9 | |||
baaefb0c31 | |||
d452aca03a | |||
10b8d94724 | |||
8606e60ef7 | |||
6a48251647 | |||
f4bf5e95ec | |||
60eac1ad43 | |||
b3cc06a6ad | |||
5553576e31 | |||
e16ad802da | |||
29c294edff | |||
59714011db | |||
51e8261a32 | |||
2a4bfad835 | |||
7e52cea66e | |||
417d7aab91 | |||
67bf761029 | |||
0eabd266ad | |||
b77fb0f226 | |||
89c2e0fb21 | |||
b88f32ed95 | |||
7a4ebe8009 | |||
0919f5c236 | |||
de02dad909 | |||
07484d0ea7 | |||
a8b557b9e2 | |||
619b2749d8 | |||
94857c983d | |||
056ed00baa | |||
aef99d20f3 | |||
e2d7ed2243 | |||
eeaeff8ec3 | |||
f5269a362a | |||
f3883a37a0 | |||
b6fd69a022 | |||
7adb7661f3 | |||
c7892e3399 | |||
aa74315df4 | |||
0b8a09ec70 | |||
b42d8f2f27 | |||
f191ec7884 | |||
28da7a0103 | |||
ece25b98a1 | |||
889172dbb1 | |||
37ce032888 | |||
701cf882ad | |||
6a94c3f158 | |||
2d993812ab | |||
4961f8327f | |||
ecdc448531 | |||
12ea49fe0c | |||
053f1613de | |||
bda18d04a0 | |||
2551295541 | |||
d5832dc1dc | |||
d2f46740e9 | |||
2f6a6554a2 | |||
30842dd9c0 | |||
b4ac5fcbe3 | |||
fef380d66f | |||
55a6fd3911 | |||
35c8a63de6 | |||
5f914e555e | |||
66dce2c158 | |||
155cac2102 | |||
22cae605e1 | |||
eb75e51975 | |||
253e180807 | |||
5d6102a00e | |||
a2dfca671e | |||
36bd80d75f | |||
1834dd6201 | |||
3d765bc703 | |||
07afd95b63 | |||
b7a10126d1 | |||
6346a0deaa | |||
8106f91981 | |||
b1fdf88f28 | |||
4d29607630 | |||
0267659adc | |||
247b176882 | |||
bcae8824ec | |||
71e7109c22 | |||
aa18b51e1c | |||
b738ac4bd7 | |||
799ce3eb30 | |||
f1e18c136f | |||
e05ec5c85f | |||
6e544d6055 | |||
90a65965ff | |||
9b53635eda | |||
7404929661 | |||
bf46fd5d9b | |||
0798bd4c5b | |||
42094c4f8b | |||
03d2dfe008 | |||
9f00ffa5af | |||
7f0d80b305 | |||
d1c1f0f0f0 | |||
acf12a6d2d | |||
b45e40bec8 | |||
3c1d452c99 | |||
53b9eda040 | |||
3b0ec998b1 | |||
d55bafde19 | |||
147462c0ab | |||
ddc7197b86 | |||
e7aa3b9d16 | |||
ff5c92fa6f | |||
443d9a2ae9 | |||
3e454f1817 | |||
c8a25c5d97 | |||
40381349ab | |||
0aa5857a76 | |||
b3b7f634e6 | |||
263ef65fec | |||
a1bd233c49 | |||
de6590cd09 | |||
56d4f82484 | |||
7fa2d6347b | |||
3be5e90481 | |||
995620a682 | |||
193e0d8d08 | |||
72ef94ab3d | |||
ccc0453df7 | |||
14ca49a042 | |||
db357b8e25 | |||
42a57dd980 | |||
5ab95f3656 | |||
5b6e39916d | |||
556951d5f0 | |||
7a88aec95f | |||
bd18323d79 | |||
b89d67dd15 | |||
704e54019a | |||
d96093171a | |||
dcc4488340 | |||
32e3fe6c07 | |||
f488947d43 | |||
71213c11b3 | |||
2964c4ab44 | |||
749f432d32 | |||
a422b53d7c | |||
c483a2cf60 | |||
dead0054a4 | |||
8ed7d465aa | |||
e5e4851d72 | |||
7f92717a2c | |||
b47d505689 | |||
4a2d051285 | |||
f3551b9734 | |||
45b98e125f | |||
dce917bfbb | |||
8f18f53aba | |||
d3f102b3b3 | |||
8bd093173d | |||
bfe5a3b840 | |||
6a0242eea3 | |||
bc4e39038a | |||
62f8ed6f61 | |||
56b67f8082 | |||
52a8f78885 | |||
a09a5ba38f | |||
5a7d8d7edf | |||
49fdc6c449 | |||
af3de2a862 | |||
c6e1b0ac8a | |||
b913dacc1b | |||
eb0ebef5a8 | |||
e0254025e8 | |||
bd010340e6 | |||
a658de2f01 | |||
4aed5589fe | |||
8ed1f5e3af | |||
ffc542eb82 | |||
74bc7ba637 | |||
5389ac6844 | |||
36fb83215a | |||
59fe8c2ad8 | |||
b8d28e7f61 | |||
7c11d07865 | |||
7c5cfbb8c3 | |||
381038eceb | |||
d6e4aa43f0 | |||
e5e09384f0 | |||
7222367f04 | |||
ab512687cf | |||
a5aaa790a0 | |||
335439dee0 | |||
45297b6f7d | |||
a7b14306d5 | |||
608952ff71 | |||
1c3d349667 | |||
b93b13263d | |||
ad342cab06 | |||
5fd85e288b | |||
322f4efc8f | |||
b6bfcdbd45 | |||
19b01078c2 | |||
68961f98c2 | |||
f0f2ea9b11 |
120
README.md
120
README.md
@ -1,12 +1,57 @@
|
|||||||
Spectre & Meltdown Checker
|
Spectre & Meltdown Checker
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
A simple shell script to tell if your Linux installation is vulnerable against the 3 "speculative execution" CVEs.
|
A shell script to tell if your system is vulnerable against the 3 "speculative execution" CVEs that were made public early 2018.
|
||||||
|
|
||||||
Without options, it'll inspect you currently running kernel.
|
Supported operating systems:
|
||||||
You can also specify a kernel image on the command line, if you'd like to inspect a kernel you're not running.
|
- Linux (all versions, flavors and distros)
|
||||||
|
- BSD (FreeBSD, NetBSD, DragonFlyBSD)
|
||||||
|
|
||||||
The script will do its best to detect mitigations, including backported non-vanilla patches, regardless of the advertised kernel version number.
|
Supported architectures:
|
||||||
|
- x86 (32 bits)
|
||||||
|
- amd64/x86_64 (64 bits)
|
||||||
|
- ARM and ARM64
|
||||||
|
- other architectures will work, but mitigations (if they exist) might not always be detected
|
||||||
|
|
||||||
|
For Linux systems, the script will detect mitigations, including backported non-vanilla patches, regardless of the advertised kernel version number and the distribution (such as Debian, Ubuntu, CentOS, RHEL, Fedora, openSUSE, Arch, ...), it also works if you've compiled your own kernel.
|
||||||
|
|
||||||
|
For BSD systems, the detection will work as long as the BSD you're using supports `cpuctl` and `linprocfs` (this is not the case of OpenBSD for example).
|
||||||
|
|
||||||
|
## Easy way to run the script
|
||||||
|
|
||||||
|
- Get the latest version of the script using `curl` *or* `wget`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -L https://meltdown.ovh -o spectre-meltdown-checker.sh
|
||||||
|
wget https://meltdown.ovh -O spectre-meltdown-checker.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
- Inspect the script. You never blindly run scripts you downloaded from the Internet, do you?
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vim spectre-meltdown-checker.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
- When you're ready, run the script as root
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x spectre-meltdown-checker.sh
|
||||||
|
sudo ./spectre-meltdown-checker.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example of script output
|
||||||
|
|
||||||
|
- Intel Haswell CPU running under Ubuntu 16.04 LTS
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- AMD Ryzen running under OpenSUSE Tumbleweed
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Batch mode (JSON flavor)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Quick summary of the CVEs
|
## Quick summary of the CVEs
|
||||||
|
|
||||||
@ -29,68 +74,15 @@ The script will do its best to detect mitigations, including backported non-vani
|
|||||||
- Mitigation: updated kernel (with PTI/KPTI patches), updating the kernel is enough
|
- Mitigation: updated kernel (with PTI/KPTI patches), updating the kernel is enough
|
||||||
- Performance impact of the mitigation: low to medium
|
- Performance impact of the mitigation: low to medium
|
||||||
|
|
||||||
## Example of script output
|
## Disclaimer
|
||||||
|
|
||||||
### Ubuntu LTS (before official patches)
|
This tool does its best to determine whether your system is immune (or has proper mitigations in place) for the collectively named "speculative execution" vulnerabilities. It doesn't attempt to run any kind of exploit, and can't guarantee that your system is secure, but rather helps you verifying whether your system has the known correct mitigations in place.
|
||||||
|
However, some mitigations could also exist in your kernel that this script doesn't know (yet) how to detect, or it might falsely detect mitigations that in the end don't work as expected (for example, on backported or modified kernels).
|
||||||
|
|
||||||
```
|
Your system exposure also depends on your CPU. As of now, AMD and ARM processors are marked as immune to some or all of these vulnerabilities (except some specific ARM models). All Intel processors manufactured since circa 1995 are thought to be vulnerable, except some specific/old models, such as some early Atoms. Whatever processor one uses, one might seek more information from the manufacturer of that processor and/or of the device in which it runs.
|
||||||
$ sudo ./spectre-and-meltdown.sh
|
|
||||||
Spectre and Meltdown mitigation detection tool v0.16
|
|
||||||
|
|
||||||
Checking for vulnerabilities against live running kernel Linux 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64
|
The nature of the discovered vulnerabilities being quite new, the landscape of vulnerable processors can be expected to change over time, which is why this script makes the assumption that all CPUs are vulnerable, except if the manufacturer explicitly stated otherwise in a verifiable public announcement.
|
||||||
Will use vmlinux image /boot/vmlinuz-4.4.0-104-generic
|
|
||||||
Will use kconfig /boot/config-4.4.0-104-generic
|
|
||||||
Will use System.map file /boot/System.map-4.4.0-104-generic
|
|
||||||
|
|
||||||
CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
|
Please also note that for Spectre vulnerabilities, all software can possibly be exploited, this tool only verifies that the kernel (which is the core of the system) you're using has the proper protections in place. Verifying all the other software is out of the scope of this tool. As a general measure, ensure you always have the most up to date stable versions of all the software you use, especially for those who are exposed to the world, such as network daemons and browsers.
|
||||||
* Kernel compiled with LFENCE opcode inserted at the proper places: NO (only 38 opcodes found, should be >= 70)
|
|
||||||
> STATUS: VULNERABLE
|
|
||||||
|
|
||||||
CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
|
This tool has been released in the hope that it'll be useful, but don't use it to jump to conclusions about your security.
|
||||||
* Mitigation 1
|
|
||||||
* Hardware (CPU microcode) support for mitigation: NO
|
|
||||||
* Kernel support for IBRS: NO
|
|
||||||
* IBRS enabled for Kernel space: NO
|
|
||||||
* IBRS enabled for User space: NO
|
|
||||||
* Mitigation 2
|
|
||||||
* Kernel compiled with retpoline option: NO
|
|
||||||
* Kernel compiled with a retpoline-aware compiler: NO
|
|
||||||
> STATUS: VULNERABLE (IBRS hardware + kernel support OR kernel with retpoline are needed to mitigate the vulnerability)
|
|
||||||
|
|
||||||
CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
|
|
||||||
* Kernel supports Page Table Isolation (PTI): NO
|
|
||||||
* PTI enabled and active: NO
|
|
||||||
> STATUS: VULNERABLE (PTI is needed to mitigate the vulnerability)
|
|
||||||
```
|
|
||||||
|
|
||||||
### First patched kernel of RHEL6
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo ./spectre-meltdown-checker.sh --kernel /tmp/vmlinuz-2.6.32-696.18.7.el6.x86_64 --config /tmp/config-2.6.32-696.18.7.el6.x86_64 --map /tmp/System.map-2.6.32-696.18.7.el6.x86_64
|
|
||||||
Spectre and Meltdown mitigation detection tool v0.16
|
|
||||||
|
|
||||||
Checking for vulnerabilities against specified kernel
|
|
||||||
Will use vmlinux image /tmp/vmlinuz-2.6.32-696.18.7.el6.x86_64
|
|
||||||
Will use kconfig /tmp/config-2.6.32-696.18.7.el6.x86_64
|
|
||||||
Will use System.map file /tmp/System.map-2.6.32-696.18.7.el6.x86_64
|
|
||||||
|
|
||||||
CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
|
|
||||||
* Kernel compiled with LFENCE opcode inserted at the proper places: YES (84 opcodes found, which is >= 70)
|
|
||||||
> STATUS: NOT VULNERABLE
|
|
||||||
|
|
||||||
CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
|
|
||||||
* Mitigation 1
|
|
||||||
* Hardware (CPU microcode) support for mitigation: NO
|
|
||||||
* Kernel support for IBRS: YES
|
|
||||||
* IBRS enabled for Kernel space: N/A (not testable in offline mode)
|
|
||||||
* IBRS enabled for User space: N/A (not testable in offline mode)
|
|
||||||
* Mitigation 2
|
|
||||||
* Kernel compiled with retpoline option: NO
|
|
||||||
* Kernel compiled with a retpoline-aware compiler: NO
|
|
||||||
> STATUS: NOT VULNERABLE (offline mode: IBRS will mitigate the vulnerability if enabled at runtime)
|
|
||||||
|
|
||||||
CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
|
|
||||||
* Kernel supports Page Table Isolation (PTI): YES
|
|
||||||
* PTI enabled and active: N/A (can't verify if PTI is enabled in offline mode)
|
|
||||||
> STATUS: NOT VULNERABLE (offline mode: PTI will mitigate the vulnerability if enabled at runtime)
|
|
||||||
```
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user