CVE-2024-53214·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: vfio/pci: Properly hide first-in-list PCIe extended capability There are cases where a PCIe extended capability should be hidden from the user. For example, an unknown capability (i.e., capability with ID greater than PCI_EXT_CAP_ID_MAX) or a capability that is intentionally chosen to be hidden from the user. Hiding a capability is done by virtualizing and modifying the 'Next Capability Offset' field of the previous capability so it points to the capability after the one that should be hidden. The special case where the first capability in the list should be hidden is handled differently because there is no previous capability that can be modified. In this case, the capability ID and version are zeroed while leaving the next pointer intact. This hides the capability and leaves an anchor for the rest of the capability list. However, today, hiding the first capability in the list is not done properly if the capability is unknown, as struct vfio_pci_core_device->pci_config_map is set to the capability ID during initialization but the capability ID is not properly checked later when used in vfio_config_do_rw(). This leads to the following warning [1] and to an out-of-bounds access to ecap_perms array. Fix it by checking cap_id in vfio_config_do_rw(), and if it is greater than PCI_EXT_CAP_ID_MAX, use an alternative struct perm_bits for direct read only access instead of the ecap_perms array. Note that this is safe since the above is the only case where cap_id can exceed PCI_EXT_CAP_ID_MAX (except for the special capabilities, which are already checked before). [1] WARNING: CPU: 118 PID: 5329 at drivers/vfio/pci/vfio_pci_config.c:1900 vfio_pci_config_rw+0x395/0x430 [vfio_pci_core] CPU: 118 UID: 0 PID: 5329 Comm: simx-qemu-syste Not tainted 6.12.0+ #1 (snip) Call Trace: <TASK> ? show_regs+0x69/0x80 ? __warn+0x8d/0x140 ? vfio_pci_config_rw+0x395/0x430 [vfio_pci_core] ? report_bug+0x18f/0x1a0 ? handle_bug+0x63/0xa0 ? exc_invalid_op+0x19/0x70 ? asm_exc_invalid_op+0x1b/0x20 ? vfio_pci_config_rw+0x395/0x430 [vfio_pci_core] ? vfio_pci_config_rw+0x244/0x430 [vfio_pci_core] vfio_pci_rw+0x101/0x1b0 [vfio_pci_core] vfio_pci_core_read+0x1d/0x30 [vfio_pci_core] vfio_device_fops_read+0x27/0x40 [vfio] vfs_read+0xbd/0x340 ? vfio_device_fops_unl_ioctl+0xbb/0x740 [vfio] ? __rseq_handle_notify_resume+0xa4/0x4b0 __x64_sys_pread64+0x96/0xc0 x64_sys_call+0x1c3d/0x20d0 do_syscall_64+0x4d/0x120 entry_SYSCALL_64_after_hwframe+0x76/0x7e
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.12.2
- Published
- 2024-12-27
Affected versions
From: 6.12
Until: 6.12.2
Fixed in: 6.12.2
How to fix this CVE
Update your Linux kernel to version 6.12.2 or later to resolve a memory access vulnerability in VFIO PCI configuration handling. The issue affects PCIe extended capability enumeration when unknown capabilities are hidden, potentially causing kernel warnings and out-of-bounds memory access. Apply the patch immediately on systems running kernel 6.12 through 6.12.1.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your current kernel version: uname -r — vulnerable if output shows 6.12.0, 6.12.1, or 6.12.x where x < 2
- Verify VFIO is in use: grep -i vfio /proc/modules — if empty, VFIO is not loaded; if present, system may be affected
- Search dmesg for the warning: sudo dmesg | grep -A 5 'vfio_pci_config_rw' — presence of this warning indicates exploitation or attempted access
- Confirm patch application: grep CONFIG_VFIO_PCI /boot/config-$(uname -r) — should show CONFIG_VFIO_PCI=m or y; then verify kernel version is 6.12.2+
FAQ
What is CVE-2024-53214?
This vulnerability affects Linux kernel VFIO PCI drivers when handling PCIe extended capabilities. The flaw occurs when the first capability in a list is unknown and should be hidden—the kernel fails to properly validate the capability ID, leading to out-of-bounds array access and kernel warnings. This only impacts systems using VFIO for PCI device passthrough, typically in virtualization scenarios.
Is CVE-2024-53214 being actively exploited?
No—this vulnerability is not listed on the CISA Known Exploited Vulnerabilities catalog and no public exploits are available. Exploitation requires local kernel access and VFIO device interaction.
What versions of Kernel are affected by CVE-2024-53214?
Linux kernel versions 6.12.0, 6.12.1, and potentially earlier builds of 6.12.x are affected. Version 6.12.2 and later contain the fix.
How do I check if my server is vulnerable to CVE-2024-53214?
Run 'uname -r' to check your kernel version. If it shows 6.12.0 or 6.12.1, you are vulnerable. Additionally, check if VFIO is in use with 'grep vfio /proc/modules'—if loaded, your system is exposed.
Does Defensia detect CVE-2024-53214?
Yes—Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Linux kernel is installed on a monitored server and running version 6.12.0 or 6.12.1, CVE-2024-53214 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/06f2fcf49854ad05a09d09e0dbee6544fff04695
- https://git.kernel.org/stable/c/0918f5643fc6c3f7801f4a22397d2cc09ba99207
- https://git.kernel.org/stable/c/1ef195178fb552478eb2587df4ad3be14ef76507
- https://git.kernel.org/stable/c/4464e5aa3aa4574063640f1082f7d7e323af8eb4
- https://git.kernel.org/stable/c/6c6502d944168cbd7e03a4a08ad6488f78d73485
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-53214. Free for 1 server.
Get started free