KVM: nSVM: Triple fault if restore host CR3 fails on nested #VMEXIT
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d82aaef9c88aa27bce63751d6d6329920b1fe8da · < 5d291ef0585ed880ed4dd71ea1a5965e0a65fb53| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
KVM: nSVM: Triple fault if restore host CR3 fails on nested #VMEXIT
If loading L1's CR3 fails on a nested #VMEXIT, nested_svm_vmexit() returns an error code that is ignored by most callers, and continues to run L1 with corrupted state. A sane recovery is not possible in this case, and HW behavior is to cause a shutdown. Inject a triple fault instead, and do not return early from nested_svm_vmexit(). Continue cleaning up the vCPU state (e.g. clear pending exceptions), to handle the failure as gracefully as possible.
From the APM:
Upon #VMEXIT, the processor performs the following actions in order to return to the host execution context:
...
if (illegal host state loaded, or exception while loading host state) shutdown else execute first host instruction following the VMRUN
Remove the return value of nested_svm_vmexit(), which is mostly unchecked anyway.
From the CVE record · Linux
In the Linux kernel’s KVM nSVM code, failure to restore L1’s CR3 during a nested VMEXIT can leave L1 running with corrupted state. This requires a nested VMEXIT where loading L1’s CR3 fails; the input does not establish whether an attacker can trigger that failure or whether authentication or user interaction is needed.
Engineers running Linux kernels with KVM nSVM should check their kernel versions; affected versions are not specified.