CVE-2024-35791

KVM: SVM: Flush pages under kvm->lock to fix UAF in svm_register_enc_region()

HIGH
7.8
CVSS Score
Published: May 17, 2024 at 12:24 PM UTC
Updated: August 5, 2026 at 12:04 PM UTC
2 products affected across 2 vendorsLinux KernelDebian Linux

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 4.19.176v ≥ 5.4.984.19.176 ≤ v < 4.205.10.15 ≤ v < 5.10.2155.11 ≤ v < 5.15.1545.11 ≤ v < 6.1.845.11 ≤ v < 6.6.245.11 ≤ v < 6.7.125.11 ≤ v < 6.85.11.1 ≤ v < 5.15.1545.16 ≤ v < 6.1.845.4.98 ≤ v < 5.56.2 ≤ v < 6.6.246.7 ≤ v < 6.7.1219a23da53932bc8011220bd8c410cb76012de0044.19.1764f627ecde7329e476a077bb0590db8f27bb8f9125.10.155.115.11 rc75.4.986.8 rc16.8 rc26.8 rc36.8 rc46.8 rc56.8 rc66.8 rc7848bcb0a1d96f67d075465667d3a1ad4af56311ef1ecde00ce1694597f923f0d25f7a797c5243d99
Vendor states this is fixed in 12f8e32a5a389a5d58afc67728c76e61beee1ad4 (fixed)
Vendor states this is fixed in 2d13b79640b147bd77c34a5998533b2021a4122d (fixed)
Vendor states this is fixed in 4868c0ecdb6cfde7c70cf478c46e06bb9c7e5865 (fixed)
Vendor states this is fixed in 5ef1d8c1ddbf696e47b226e11888eaf8d9e8e807 (fixed)
Vendor states this is fixed in e126b508ed2e616d679d85fca2fbe77bb48bbdd7 (fixed)
Vendor states this is fixed in f6d53d8a2617dd58c89171a6b9610c470ebda38a (fixed)
Affected range stops below 4.20, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 5.10.215 (unaffected)
Vendor states this is fixed in 5.11 (unaffected)
Vendor states this is fixed in 5.15.154 (unaffected)
Affected range stops below 5.5, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 6.1.84 (unaffected)
Vendor states this is fixed in 6.6.24 (unaffected)
Vendor states this is fixed in 6.7.12 (unaffected)
Vendor states this is fixed in 6.8 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/12f8e32a5a389a5d58afc67728c76e61beee1ad4
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/2d13b79640b147bd77c34a5998533b2021a4122d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/4868c0ecdb6cfde7c70cf478c46e06bb9c7e5865
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/5ef1d8c1ddbf696e47b226e11888eaf8d9e8e807
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e126b508ed2e616d679d85fca2fbe77bb48bbdd7
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/f6d53d8a2617dd58c89171a6b9610c470ebda38a
Third Party Advisory
Source: af854a3a-2127-422b-91ae-364da2661108
https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.8HIGHLinux
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card