CVE-2024-26992: KVM: x86/pmu: Disable support for adaptive PEBS
In the Linux kernel, the following vulnerability has been resolved:
KVM: x86/pmu: Disable support for adaptive PEBS
Drop support for virtualizing adaptive PEBS, as KVM's implementation is architecturally broken without an obvious/easy path forward, and because exposing adaptive PEBS can leak host LBRs to the guest, i.e. can leak host kernel addresses to the guest.
Bug #1 is that KVM doesn't account for the upper 32 bits of IA32FIXEDCTRCTRL when (re)programming fixed counters, e.g fixedctrlfield() drops the upper bits, reprogramfixedcounters() stores local variables as u8s and truncates the upper bits too, etc.
Bug #2 is that, because KVM always sets preciseip to a non-zero value for PEBS events, perf will always generate an adaptive record, even if the guest requested a basic record. Note, KVM will also enable adaptive PEBS in individual counter, even if adaptive PEBS isn't exposed to the guest, but this is benign as MSRPEBSDATACFG is guaranteed to be zero, i.e. the guest will only ever see Basic records.
Bug #3 is in perf. intelpmudisablefixed() doesn't clear the upper bits either, i.e. leaves ICLFIXED0ADAPTIVE set, and intelpmuenablefixed() effectively doesn't clear ICLFIXED0ADAPTIVE either. I.e. perf always enables ADAPTIVE counters, regardless of what KVM requests.
Bug #4 is that adaptive PEBS might effectively bypass event filters set by the host, as "Updated Memory Access Info Group" records information that might be disallowed by userspace via KVMSETPMUEVENTFILTER.
Bug #5 is that KVM doesn't ensure LBR MSRs hold guest values (or at least zeros) when entering a vCPU with adaptive PEBS, which allows the guest to read host LBRs, i.e. host RIPs/addresses, by enabling "LBR Entries" records.
Disable adaptive PEBS support as an immediate fix due to the severity of the LBR leak in particular, and because fixing all of the bugs will be non-trivial, e.g. not suitable for backporting to stable kernels.
Note! This will break live migration, but trying to make KVM play nice with live migration would be quite complicated, wouldn't be guaranteed to work (i.e. KVM might still kill/confuse the guest), and it's not clear that there are any publicly available VMMs that support adaptive PEBS, let alone live migrate VMs that support adaptive PEBS, e.g. QEMU doesn't support PEBS in any capacity.
Other sources
In the Linux kernel, the following vulnerability has been resolved:
KVM: x86/pmu: Disable support for adaptive PEBS
The Linux kernel CVE team has assigned CVE-2024-26992 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024050144-CVE-2024-26992-4f0e@gregkh/T
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.1.88 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.6.29 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.8.8 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.9 - Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch CVE-2024-26992 - Configuration
Disable support for virtualizing adaptive PEBS in KVM (x86/pmu) immediately, because KVM’s adaptive PEBS implementation is architecturally broken and exposing adaptive PEBS can leak host LBRs to the guest.
KVM (x86/pmu) adaptive PEBS support / virtualizing adaptive PEBS = disabled
Event History
Frequently Asked Questions
What is the severity of CVE-2024-26992?
CVE-2024-26992 is classified as a moderate severity vulnerability.
What versions of the Linux kernel are affected by CVE-2024-26992?
CVE-2024-26992 affects multiple versions of the Linux kernel, including versions prior to 6.1.88, 6.6.29, 6.8.8, 6.9, and several specific 5.10.x versions.
How do I fix CVE-2024-26992?
To mitigate CVE-2024-26992, update to the latest version of the Linux kernel as specified in the vulnerability report.
Which operating systems are impacted by CVE-2024-26992?
CVE-2024-26992 impacts Linux distributions that use affected versions of the kernel, including those from Red Hat and Debian.
Is user intervention required for the update related to CVE-2024-26992?
Yes, user intervention is required to manually apply the kernel updates to mitigate CVE-2024-26992.