CVE-2026-139549: nvdimm/pmem: Release gendisk on probe failure
In the Linux kernel, the following vulnerability has been resolved:
nvdimm/pmem: Release gendisk on probe failure
pmemattachdisk() allocates the gendisk with blkallocdisk() and hands it to devres only once deviceadddisk() has succeeded. Until that point the probe path owns the disk itself, which is why every failure after the allocation jumps to the out: label and puts it there.
The devminitbadblocks() failure returns directly instead, so the disk allocated a few lines earlier is never released. Nothing releases it afterwards either: the devres action that would have done so has not been registered yet, so unbinding the namespace or destroying it does not reach the disk, and it stays allocated along with its queue and its bdev inode until the machine is rebooted.
devminitbadblocks() only fails when a single page allocation fails, so reaching this at all needs memory exhaustion during namespace probe, and because deviceadddisk() has not run there is nothing user visible left behind: no device node, no sysfs entry, only the leaked memory.
Release the gendisk through the existing cleanup path on this failure.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In nvdimm/pmem, route a devm_init_badblocks() failure through the existing out: cleanup path so the gendisk is released, rather than returning directly.
Event History
Frequently Asked Questions
Which systems are exposed to this leak?
The issue applies during probing of an nvdimm/pmem namespace in the Linux kernel. It requires the probe path to reach devm_init_badblocks() and have its single-page allocation fail due to memory exhaustion.
What is required to trigger the condition?
Memory exhaustion must occur while the pmem namespace is being probed. The available data does not identify a remote trigger or indicate that an unprivileged attacker can directly cause the failure.
How can I tell whether a failed probe left affected resources behind?
There is no user-visible device node or sysfs entry because device_add_disk() has not run. The observable consequence described is leaked memory, including the gendisk, queue, and bdev inode.
What can be done if the fix cannot be applied immediately?
Unbinding or destroying the namespace does not release the leaked disk because the cleanup action was not registered. The leaked resources remain allocated until the machine is rebooted.