CVE-2026-139460: PCI/P2PDMA: Do not tear down the allocate attribute on registration failure

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

PCI/P2PDMA: Do not tear down the allocate attribute on registration failure

pcip2pdmaaddresource() installs pcip2pdmaunmapmappings() as a devres action with the devres allocated p2ppgmap as its data, and only then adds the range to the pool:

error = devmaddactionorreset(&pdev->dev, pcip2pdmaunmapmappings, p2ppgmap); if (error) goto pagesfree;

p2pdma = rcudereferenceprotected(pdev->p2pdma, 1); error = genpooladdowner(p2pdma->pool, ...); if (error) goto pagesfree;

The action removes the allocate attribute for the whole device, which tears down existing userspace mappings of every BAR already registered on it. Both failures here get that wrong, in opposite ways.

devmaddactionorreset() runs the action when it cannot allocate its devres node, so an -ENOMEM while registering a second BAR unmaps the first one. Use devmaddaction() and let the error path unwind only what this call created.

genpooladdowner() allocates a chunk and can also fail with -ENOMEM. There the action is registered, and the error path frees p2ppgmap with devmkfree() while leaving the action pointing at it. On unbind devres runs the action and pcip2pdmaunmapmappings() dereferences p2ppgmap->mem->owner->kobj, which is freed memory. Give that failure its own label and drop the action with devmremoveaction(), which removes it without running it.

Affected Software

7 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.2.0<6.12.120
6.12.120
linux/kernel>=6.13.0<6.18.65
6.18.65
linux/kernel>=6.19.0<7.3.6
7.3.6
debian/linux*
debian/linux<7.3.6-1
7.3.6-1
debian/linux<=6.12.117-1, <=6.12.118-1
7.3.6-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.120
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.65
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.6
  4. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 7.3.6-1
  5. Compensating control

    In pci_p2pdma_add_resource(), use devm_add_action() instead of devm_add_action_or_reset() to register pci_p2pdma_unmap_mappings(). On the gen_pool_add_owner() error path, free the p2p_pgmap and call devm_remove_action() to remove the registered action without running it.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:34 PM
Data Sourced
via MITRE·01:34 PM
Description
Data Sourced
via OSV·01:34 PM
DescriptionAffected Software
Data Sourced
via NVD·02:19 PM
Description

Frequently Asked Questions

1

Which systems are most likely to encounter the first failure mode?

Systems registering a second BAR for PCI P2PDMA are affected if devm_add_action_or_reset() fails to allocate its devres node with -ENOMEM. In that case, existing userspace mappings for BARs already registered on the device can be unmapped.

2

What is the consequence of memory allocation failure while adding the P2PDMA pool range?

If gen_pool_add_owner() fails with -ENOMEM, the registered cleanup action can retain a pointer to p2p_pgmap after that object is freed. The stale action is later relevant when the device is unbound.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203