CVE-2026-138901: PCI/DOE: Fix double free of a duplicate feature's sysfs name
In the Linux kernel, the following vulnerability has been resolved:
PCI/DOE: Fix double free of a duplicate feature's sysfs name
When a DOE feature is reported twice, sysfsaddfiletogroup() fails with -EEXIST for the second copy and pcidoesysfsfeaturepopulate() frees that attribute's name, but leaves the pointer in place. pcidoesysfsfeatureremove() frees every name again when the device is removed, or when a later feature fails to register, so the name is freed twice:
BUG: KASAN: double-free in pcidoesysfsfeatureremove+0x117/0x1b0 Call Trace: kfree+0x11a/0x420 pcidoesysfsfeatureremove+0x117/0x1b0 pcidoesysfsteardown+0x90/0xf0 pciremovebusdevice+0x128/0x2e0 pcistopandremovebusdevicelocked+0x1d/0x30 removestore+0xd2/0xf0
Clear the pointer after freeing the name.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Compensating control
Clear the sysfs attribute name pointer after freeing the name to prevent a double-free during teardown.
Event History
Frequently Asked Questions
What condition is required to trigger the double free?
A PCI DOE feature must be reported twice. Registration of the second copy then fails because its sysfs attribute already exists, leaving a freed name pointer behind.
When does the stale pointer get freed a second time?
The second free occurs when the PCI device is removed or when registration of a later DOE feature fails. During teardown, the removal path frees every feature name, including the pointer that was already freed after the duplicate registration failure.
How can an affected system be identified?
A KASAN-enabled kernel may report a double-free in pci_doe_sysfs_feature_remove, with teardown-related calls such as pci_doe_sysfs_teardown and PCI device removal in the stack trace. The issue is associated with a device reporting a duplicate DOE feature.