CVE-2026-72487: PCI: Check ROM header and data structure addr before accessing
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
PCI: Check ROM header and data structure addr before accessing
We meet a crash when running stress-ng on x86_64 machine:
BUG: unable to handle page fault for address: ffa0000007f40000
RIP: 0010:pci_get_rom_size+0x52/0x220
Call Trace:
<TASK>
pci_map_rom+0x80/0x130
pci_read_rom+0x4b/0xe0
kernfs_file_read_iter+0x96/0x180
vfs_read+0x1b1/0x300Our analysis reveals that the ROM space's start address is 0xffa0000007f30000, and size is 0x10000. Because of broken ROM space, before calling readl(pds), the pds's value is 0xffa0000007f3ffff, which is already pointed to the ROM space end, invoking readl() would read 4 bytes therefore cause an out-of-bounds access and trigger a crash. Fix this by adding image header and data structure checking.
We also found another crash on arm64 machine:
Unable to handle kernel paging request at virtual address ffff8000dd1393ff Mem abort info: ESR = 0x0000000096000021 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x21: alignment fault
The call trace is the same with x86_64, but the crash reason is that the data structure addr is not aligned with 4, and arm64 machine report "alignment fault". Fix this by adding alignment checking.
[bhelgaas: shorten function names, wrap comments]
The Linux kernel CVE team has assigned CVE-2026-72487 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.5 with commit 47b975d234eac39f3a72e5496d5f6158d8b806d1 and fixed in 6.1.178 with commit cd5b242d5848369b9e957340a7e30adee7b6763d Issue introduced in 4.5 with commit 47b975d234eac39f3a72e5496d5f6158d8b806d1 and fixed in 6.6.145 with commit 4997873e3abbad47a9e1e4abd05f045f77a74f22 Issue introduced in 4.5 with commit 47b975d234eac39f3a72e5496d5f6158d8b806d1 and fixed in 6.12.97 with commit 724042f8f98d2594b9d164549fd4292c6bd58120 Issue introduced in 4.5 with commit 47b975d234eac39f3a72e5496d5f6158d8b806d1 and fixed in 6.18.40 with commit 1d495446ec7ace5b61da366ffb161ee8319dd9a2 Issue introduced in 4.5 with commit 47b975d234eac39f3a72e5496d5f6158d8b806d1 and fixed in 7.1.5 with commit 721ad5b72448b5065ed309017ab563205f162404 Issue introduced in 4.5 with commit 47b975d234eac39f3a72e5496d5f6158d8b806d1 and fixed in 7.2-rc1 with commit 538796b807fcfb81b2ce40cc97a614fd8588feb5
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-72487
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/pci/rom.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/cd5b242d5848369b9e957340a7e30adee7b6763d https://git.kernel.org/stable/c/4997873e3abbad47a9e1e4abd05f045f77a74f22 https://git.kernel.org/stable/c/724042f8f98d2594b9d164549fd4292c6bd58120 https://git.kernel.org/stable/c/1d495446ec7ace5b61da366ffb161ee8319dd9a2 https://git.kernel.org/stable/c/721ad5b72448b5065ed309017ab563205f162404 https://git.kernel.org/stable/c/538796b807fcfb81b2ce40cc97a614fd8588feb5