Skip to content

Conversation

@rrobgill
Copy link
Contributor

@rrobgill rrobgill commented Oct 28, 2018

Tests for presence of hypervisor flag in /proc/cpuino if available and tests for evidence of hypervisor in dmesg. (Rather than relying on output of ps).

Also fix unset $l1d_mode causing error & typos.

Update processor names of atom 6 family processors to align with those from kernel as of October 2018.

``` opt_batch_format="text" ``` replaced by ``` opt_batch_format='text' ```
```nrpe_vuln='"" ``` replaced by ``` nrpe_vuln='' ``` , as used by other parse options

Redundant ``` ! -z ``` replaced by ``` -n ```, as used elsewhere

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
Tests for presence of hypervisor flag in /proc/cpuino
Tests for evidence of hypervisor in dmesg

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
…ailable

(prevents invalid number error when evaluating [ "$l1d_mode" -ge 1 ])

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
Another instance of unset l1d_mode causing error "./spectre-meltdown-checker.sh: 3867: [: Illegal number:"
@speed47
Copy link
Owner

speed47 commented Nov 25, 2018

Thanks for your work, and sorry for the time it took me to check your PR!
All good and well for the fixes, readme update and atom name updates.

On the "has_vmm" code however, your version of the code (which is way less dumb than the ps indeed), changes the meaning of the check, as I understand it. You've implemented several ways of detecting whether we were run from inside a VM, but the original check actually checks if we're running on a "bare metal" host that is hosting VMs. This is because the L1D cache flushing must be done by the host kernel and the hypervisor, not from inside the VM. But if you're running a simple server (or desktop) without VMs on it, then it's not an issue and you don't even need mitigation. Am I reading your code correctly?

@rrobgill
Copy link
Contributor Author

Yes, effectively reversing the detection assuming bare metal if not detected as inside the vm.

@speed47
Copy link
Owner

speed47 commented Dec 10, 2018

Indeed, so we make the assumption that if we're on bare metal, we possibly are actually hosting an hypervisor that might host VMs. This is probably reasonable, and the behavior can still be overridden through the comand-line, if we are on bare metal and we know we'll never run VMs on it.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants