CVE-2024-35791: KVM: SVM: Flush pages under kvm->lock to fix UAF in svm_register_enc_region()
In the Linux kernel, the following vulnerability has been resolved:
KVM: SVM: Flush pages under kvm->lock to fix UAF in svm_register_enc_region()
Do the cache flush of converted pages in svm_register_enc_region() before
dropping kvm->lock to fix use-after-free issues where region and/or its
array of pages could be freed by a different task, e.g. if userspace has
__unregister_enc_region_locked() already queued up for the region.
Note, the "obvious" alternative of using local variables doesn't fully
resolve the bug, as region->pages is also dynamically allocated. I.e. the
region structure itself would be fine, but region->pages could be freed.
Flushing multiple pages under kvm->lock is unfortunate, but the entire
flow is a rare slow path, and the manual flush is only needed on CPUs that
lack coherency for encrypted memory.
Security readout for executives and security teams
Plain-English summary
A race condition in Linux KVM’s SVM encrypted-memory handling can access memory after it has been freed. A locally privileged user could potentially compromise confidentiality, integrity, or availability on affected virtualization hosts. The issue is limited to a rare processing path and requires local access; ordinary remote traffic alone is not an identified attack path.
Executive priority
Treat as a high-priority maintenance issue for exposed virtualization hosts, especially multi-user or shared environments. It is not supported as an emergency internet-wide threat because local access and specific KVM functionality are required, and no active exploitation is documented. Patch during the next expedited kernel maintenance window after confirming applicability with the operating-system vendor.
Technical view
In svm_register_enc_region(), converted pages were flushed after kvm->lock was released. Another task could unregister the region and free either the region or its dynamically allocated pages, causing a use-after-free. The correction performs the flush while holding kvm->lock. The vulnerable flow concerns KVM SVM encrypted-memory registration and is described as a rare slow path.
Likely exposure
Prioritize Linux virtualization hosts using KVM SVM and encrypted-memory region registration. The supplied CVSS vector requires local, low-privileged access and no user interaction. Systems not exercising this functionality likely have lower practical exposure, but version fragments in the bundle are insufficient for reliable package-level conclusions; verify distribution builds against vendor advisories and the cited stable fixes.
Exploitation context
The supplied record is not in CISA KEV, and the provided sources do not report active exploitation or a public exploit. Exploitation would require reaching a timing-dependent local race in the affected virtualization path. CVSS 3.1 rates it 7.8, with potential high confidentiality, integrity, and availability impact, but observed real-world outcomes are not documented here.
Researcher notes
The critical lifetime issue covers both the region structure and region->pages; copying only the outer pointer would not resolve the race. The fix trades longer lock holding for safe object lifetime during cache flushing. Manual flushing applies only to CPUs lacking encrypted-memory coherency. The bundle provides no CWE assignment, proof of exploitation, or sufficient package-range detail for definitive fleet matching.
Mitigation direction
Apply the appropriate vendor kernel update containing the cited stable fix.
Follow distribution guidance when mapping package versions to corrected upstream commits.
Prioritize shared virtualization hosts where untrusted local users can access relevant KVM functionality.
Restrict unnecessary local access to virtualization interfaces until maintenance is complete.
Validation and detection
Inventory Linux hosts running KVM with SVM capabilities and encrypted-memory workloads.
Record kernel and distribution package versions for each potentially exposed host.
Confirm the installed build contains the applicable cited stable-kernel correction.
Review vendor advisories because the supplied version list does not express reliable package ranges.
After updating, confirm hosts booted into the corrected kernel.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-35791 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.