KVM: nSVM: Always use NextRIP as vmcb02's NextRIP after first L2 VMRUN
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ cc440cdad5b7a4c1de12dace725209eb3e0cf663 · < 8d397582f6b5e9fbcf09781c7c934b4910e94a50| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
KVM: nSVM: Always use NextRIP as vmcb02's NextRIP after first L2 VMRUN
For guests with NRIPS disabled, L1 does not provide NextRIP when running an L2 with an injected soft interrupt, instead it advances the current RIP before running it. KVM uses the current RIP as the NextRIP in vmcb02 to emulate a CPU without NRIPS.
However, after L2 runs the first time, NextRIP will be updated by the CPU and/or KVM, and the current RIP is no longer the correct value to use in vmcb02. Hence, after save/restore, use the current RIP if and only if a nested run is pending, otherwise use NextRIP. Give soft_int_next_rip the same treatment, as it's the same logic, just for a narrower use case.
[sean: give soft_int_next_rip the same treatment]
From the CVE record · Linux
Linux kernel KVM nSVM can use the wrong NextRIP after an L2 guest has run and its state is saved and restored. This occurs when NRIPS is disabled and an L2 guest runs with an injected software interrupt; the input does not specify an attacker path or resulting impact.
Engineers running Linux kernel KVM nSVM with nested guests should check their kernel versions; affected versions are not specified.