CVE-2026-139549

nvdimm/pmem: Release gendisk on probe failure

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

nvdimm/pmem: Release gendisk on probe failure

pmem_attach_disk() allocates the gendisk with blk_alloc_disk() and hands
it to devres only once device_add_disk() 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 devm_init_badblocks() 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.

devm_init_badblocks() only fails when a single page allocation fails, so
reaching this at all needs memory exhaustion during namespace probe, and
because device_add_disk() 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.

Analysis

AI-generated

Technical impact

In the Linux kernel, the nvdimm/pmem driver fails to release a gendisk when probe fails after an earlier disk allocation. The failure occurs only when a page allocation for badblocks initialization drops, a condition that arises under memory exhaustion. The unfreed disk, queue, and block device inode persist in memory until the machine is rebooted. The leak is not visible to users as no device node or sysfs entry appears, but it steadily consumes kernel memory, potentially leading to a denial‑of‑service if the system repeatedly attempts to attach memory devices under constrained conditions.

Affected Systems

All Linux kernel versions sourcing the nvdimm/pmem driver prior to the applied patch are affected. No specific version range is listed; the vulnerability applies to any kernel implementation that includes the unguarded gendisk release path before the bug fix.

Risk and Exploitability

The vulnerability has no publicly available exploit code and is listed as not in the CISA KEV catalog. The EPSS score is not available, so the probability of attack remains unclear. The primary risk is a self‑limited denial‑of‑service scenario caused by accumulated memory leaks when a memory device probe fails, which requires an attacker to induce a page allocation failure—a scenario typically only feasible in constrained or specialized environments.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the fix for the nvdimm/pmem gendisk leak.
  • If an immediate kernel upgrade is not possible, limit the use of nvdimm/pmem devices or disable the driver to prevent the leak during probe failures.
  • Monitor system memory and kernel log messages for signs of repeated allocation failures and consider implementing resource limits to mitigate prolonged memory consumption.

Generated by OpenCVE AI on November 30, 2026 at 23:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-400
CWE-401
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: nvdimm/pmem: Release gendisk on probe failure pmem_attach_disk() allocates the gendisk with blk_alloc_disk() and hands it to devres only once device_add_disk() 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 devm_init_badblocks() 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. devm_init_badblocks() only fails when a single page allocation fails, so reaching this at all needs memory exhaustion during namespace probe, and because device_add_disk() 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.
Title nvdimm/pmem: Release gendisk on probe failure
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-401

    Missing Release of Memory after Effective Lifetime

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:35 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM