PT-2026-163501
CVE-2026-139460
·
Published
2026-11-30
·
Updated
2026-11-30
Description by
Score
N/A
Not availableNo severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
In the Linux kernel, the following vulnerability has been resolved:
PCI/P2PDMA: Do not tear down the allocate attribute on registration failure
pci p2pdma add resource() installs pci p2pdma unmap mappings() as a devres
action with the devres allocated p2p pgmap as its data, and only then adds
the range to the pool:
error = devm add action or reset(&pdev->dev, pci p2pdma unmap mappings,
p2p pgmap);
if (error)
goto pages free;
p2pdma = rcu dereference protected(pdev->p2pdma, 1);
error = gen pool add owner(p2pdma->pool, ...);
if (error)
goto pages free;
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.
devm add action or reset() runs the action when it cannot allocate its
devres node, so an -ENOMEM while registering a second BAR unmaps the first
one. Use devm add action() and let the error path unwind only what this
call created.
gen pool add owner() allocates a chunk and can also fail with -ENOMEM.
There the action is registered, and the error path frees p2p pgmap with
devm kfree() while leaving the action pointing at it. On unbind devres
runs the action and pci p2pdma unmap mappings() dereferences
p2p pgmap->mem->owner->kobj, which is freed memory. Give that failure its
own label and drop the action with devm remove action(), which removes it
without running it.
Found an issue in the description? Have something to add? Feel free to write us 👾