Commit Graph
2 Commits
Author SHA1 Message Date
Dario Faggioli 5e83e2cfa4 L1TF/Linux: Fix "running an hypervisor" detection via sysfs
If we can look in `/sys/devices/system/cpu/vulnerabilities/l1tf`, and
we find 'VMX' in it, it means we can run KVM guests, and hence we are
running as an hypervisor.

Right now, on a system with VMX enabled, with KVM guests running, and
booted with "l1tf=off", I see this:
`
  CVE-2018-3646 aka 'Foreshadow-NG (VMM), L1 terminal fault'
  * Information from the /sys interface: VMX: vulnerable
  * This system is a host running a hypervisor:  NO
  ... ... ...
    * L1D flush enabled:  NO
  > STATUS:  NOT VULNERABLE  (this system is not running a hypervisor)
`
Which is wrong.

In fact, as said, guests are running, so we are an hypervisor,
and with "l1tf=off" (and hence L1D flush disabled) we are vulnerable.
2019-04-18 18:59:03 +02:00
Dario Faggioli 2cfae92cb0 L1TF/Linux: remove dead code, fix --sysfs-only bug
We don't use $msg and $status.

Also, by always initializing l1d_mode, we fix the following "crash",
when running with `--sysfs-only`:
`
  CVE-2018-3646 aka 'Foreshadow-NG (VMM), L1 terminal fault'
  * Information from the /sys interface: VMX: vulnerable
  ./spectre-meltdown-checker.sh: line 3945: [: : integer expression expected
`
2019-04-18 18:08:22 +02:00