Vulnerability · Published Dec 27, 2024 · Assigned by Linux

CVE-2024-53214vfio/pci: Properly hide first-in-list PCIe extended capability

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 17% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.3%top 82.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.123-1DEBIAN-CVE-2024-53214
Debian:13linux6.12.3-1DEBIAN-CVE-2024-53214
Debian:14linux6.12.3-1DEBIAN-CVE-2024-53214
Ubuntu:22.04:LTSlinux5.15.0-135.146UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux6.8.0-58.60UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-aws5.15.0-1080.87UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-aws6.8.0-1027.29UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1027.29~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure5.15.0-1084.93UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-azure6.8.0-1027.32UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-azure-6.116.11.0-1012.12~24.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1027.32~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1084.93.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-azure-nvidia6.8.0-1014.15UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-gcp5.15.0-1079.88UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-gcp6.8.0-1028.30UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-gcp-6.116.11.0-1011.11~24.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1028.30~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-gke5.15.0-1077.83UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-gke6.8.0-1023.27UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1062.70UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1010.12UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-58.60~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-ibm5.15.0-1072.75UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-ibm6.8.0-1024.24UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1024.24~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-intel-iot-realtime5.15.0-1073.75UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1075.81UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-kvm5.15.0-1076.81UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-135.146UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-58.60.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-58.60.1~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1074.75UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1026.29UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-nvidia-6.116.11.0-1007.7UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1026.29~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1026.29.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1033.33UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-nvidia-tegra6.8.0-1008.8UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1021.21UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1015.15UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1026.26UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-oracle5.15.0-1077.83UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-oracle6.8.0-1024.25UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1024.25~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-raspi5.15.0-1074.77UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-raspi6.8.0-1028.32UBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-riscv6.8.0-58.60.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-58.60.1~22.04.1UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-53214
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1017.18UBUNTU-CVE-2024-53214
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1044.48UBUNTU-CVE-2024-53214

Affected products (as reported)

VendorProductVersions
Linux Linux 89e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 4464e5aa3aa4574063640f1082f7d7e323af8eb489e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 7d121f66b67921fb3b95e0ea9856bfba53733e9189e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 0918f5643fc6c3f7801f4a22397d2cc09ba9920789e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 9567bd34aa3b986736c290c5bcba47e0182ac47a89e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 6c6502d944168cbd7e03a4a08ad6488f78d7348589e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 06f2fcf49854ad05a09d09e0dbee6544fff0469589e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 949bee8065a85a5c6607c624dc05b5bc1711969989e1f7d4c66d85f42c3d52ea3866eb10cadf6153 – before 1ef195178fb552478eb2587df4ad3be14ef76507
Linux Linux 3.6

Weakness: CWE-129 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References