KVM: x86: Ensure vendor's exit handler runs before fastpath userspace exits
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
KVM: x86: Ensure vendor's exit handler runs before fastpath userspace exits
Move the handling of fastpath userspace exits into vendor code to ensure KVM runs vendor specific operations that need to run before userspace gains control of the vCPU. E.g. for VMX (and soon to be for SVM as well), KVM needs to flush the PML buffer prior to exiting to userspace, otherwise any memory written by the final KVM_RUN might never be flagged as dirty.
Note, waiting to snapshot CR0 and CR3 until svm_handle_exit() is flawed in general, as that risks consuming stale state in a fastpath handler. That will be addressed in a future change.
From the CVE record · Linux
KVM x86 can return to userspace through a fastpath exit before running vendor-specific exit handling. On VMX, this can leave the PML buffer unflushed, so memory written during the final KVM_RUN might never be marked dirty. The input does not specify attacker access requirements or user interaction.
Engineers running Linux hosts with KVM x86 should check their kernel; affected versions are not specified.