CVE-2024-35791·Kernel vulnerability
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.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.7.12
- Published
- 2024-05-17
Affected versions
From: 6.7
Until: 6.7.12
Fixed in: 6.7.12
How to fix this CVE
Update your Linux kernel to version 6.7.12 or later to patch a use-after-free vulnerability in the KVM SVM encrypted region registration code. This issue occurs when memory pages are flushed after releasing the kernel lock, allowing concurrent unregister operations to free the region structure while it is still in use. Apply the kernel update and reboot your system to complete remediation.
sudo dnf update kernel kernel-devel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed kernel version with 'uname -r' and compare against the affected range 6.7.0-6.7.11
- Step 2: Verify KVM is enabled and in use by running 'lsmod | grep kvm' and checking for encrypted VM regions with 'cat /proc/cmdline | grep -i sev'
- Step 3: Search system logs for UAF-related kernel panics or warnings with 'dmesg | grep -i "use-after-free\|svm_register\|kvm"'
- Step 4: After applying the kernel update, run 'uname -r' to confirm version is 6.7.12 or later, then verify with 'sudo dmesg | tail -20' for any related warnings
FAQ
What is CVE-2024-35791?
This vulnerability is a use-after-free flaw in the Linux kernel's KVM (Kernel Virtual Machine) SVM implementation, specifically in the svm_register_enc_region() function. The bug occurs when encrypted memory pages are flushed after the kernel lock is released, allowing a concurrent unregister operation to free the region structure prematurely.
Is CVE-2024-35791 being actively exploited?
No, this vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and has no public exploits available. However, it remains a high-severity issue requiring timely patching.
What versions of Kernel are affected by CVE-2024-35791?
Linux kernel versions 6.7.0 through 6.7.11 are affected. The vulnerability is resolved in kernel version 6.7.12 and later.
How do I check if my server is vulnerable to CVE-2024-35791?
Run 'uname -r' to display your kernel version. If the output shows a version between 6.7.0 and 6.7.11 inclusive, your system is vulnerable and requires an immediate kernel update.
Does Defensia detect CVE-2024-35791?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel package is installed on a monitored server running versions 6.7.0-6.7.11, CVE-2024-35791 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/12f8e32a5a389a5d58afc67728c76e61beee1ad4
- https://git.kernel.org/stable/c/2d13b79640b147bd77c34a5998533b2021a4122d
- https://git.kernel.org/stable/c/4868c0ecdb6cfde7c70cf478c46e06bb9c7e5865
- https://git.kernel.org/stable/c/5ef1d8c1ddbf696e47b226e11888eaf8d9e8e807
- https://git.kernel.org/stable/c/e126b508ed2e616d679d85fca2fbe77bb48bbdd7
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-35791. Free for 1 server.
Get started free