CVE-2026-139459: PCI/P2PDMA: Wait for RCU readers before freeing state
In the Linux kernel, the following vulnerability has been resolved:
PCI/P2PDMA: Wait for RCU readers before freeing state
pcip2pmemfindmany() scans all PCI devices without locking or protection against driver unbind, including devices with poolless P2PDMA state. pcihasp2pmem() may observe pdev->p2pdma just before driver unbind clears it, while pcip2pdmarelease() skips the grace period when no pool is present. This allows devres to free the object while it is still in use.
Clear the pointer with RCUINITPOINTER() and always wait for pre-existing RCU readers before returning. The same grace period continues to protect genpool users for pool-backed providers.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Clear the p2pdma pointer with RCU_INIT_POINTER() and always wait for pre-existing RCU readers before returning, including when no pool is present.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using Linux kernel PCI peer-to-peer DMA functionality are relevant, particularly where PCI devices can be scanned for P2PDMA providers while a provider driver is being unbound. Providers with poolless P2PDMA state are specifically implicated.
What condition triggers the unsafe access?
The race occurs when pci_p2pmem_find_many() or pci_has_p2pmem() observes a device's P2PDMA state just before driver unbind clears it. The release path can then allow devres to free that state while an existing reader still uses it.
What does the resolved change do to prevent the race?
It clears the P2PDMA pointer with RCU_INIT_POINTER() and waits for pre-existing RCU readers before the release path returns, including when no pool is present. The grace period also continues to protect gen_pool users for pool-backed providers.