CVE-2026-139787

nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl()

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

nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl()

nvme_tcp_free_ctrl() reads ctrl->ctrl.opts to know how many queue
mutexes to destroy. When creating the controller fails,
nvmf_create_ctrl() frees opts as soon as nvme_tcp_create_ctrl()
returns, but a concurrent open of the character device can hold the
last reference to the controller. With CONFIG_DEBUG_KOBJECT_RELEASE,
which delays the release, every failed connect reads freed memory:

BUG: KASAN: slab-use-after-free in nvme_tcp_free_ctrl+0x38b/0x430
Read of size 4 at addr ffff888005b93740 by task kworker/2:1/51

Keep the size of the queue array in the controller and use it instead.

Analysis

AI-generated

Technical impact

The Linux kernel implementation of NVMe over TCP contains a use‑after‑free bug in nvme_tcp_free_ctrl(). When a controller creation fails, the associated options structure is freed while a concurrent reference may still exist. A subsequent call to nvme_tcp_free_ctrl() reads this freed memory, triggering a KASAN error and corrupting kernel data. This kernel memory corruption could potentially be exploited to alter control flow or crash the system (inferred).

Affected Systems

All Linux kernel deployments that ship the unpatched nvme‑tcp implementation are impacted. The flaw is present in any kernel version that contains the buggy nvme_tcp_free_ctrl() routine before the fix commit. Systems running a patched kernel are not affected.

Risk and Exploitability

The affected code runs in kernel mode with full privileges. The lack of an EPSS score and absence from KEV list means exploitation probability is not quantified, but the severity of kernel memory corruption suggests a high‑impact outcome. The entry appears to be local in nature; the data does not explicitly provide details about remote exploitation. If the host accepts external NVMe over TCP connections, it could be remotely triggered – this scenario is inferred from the code path but not shown in the CVE data.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel update that includes the nvme‑tcp use‑after‑free fix
  • If an immediate kernel upgrade is not possible, disable the nvme‑tcp module or block NVMe over TCP traffic on the affected system
  • Monitor system logs for KASAN or kernel panic messages indicating memory corruption

Generated by OpenCVE AI on December 1, 2026 at 02:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl() nvme_tcp_free_ctrl() reads ctrl->ctrl.opts to know how many queue mutexes to destroy. When creating the controller fails, nvmf_create_ctrl() frees opts as soon as nvme_tcp_create_ctrl() returns, but a concurrent open of the character device can hold the last reference to the controller. With CONFIG_DEBUG_KOBJECT_RELEASE, which delays the release, every failed connect reads freed memory: BUG: KASAN: slab-use-after-free in nvme_tcp_free_ctrl+0x38b/0x430 Read of size 4 at addr ffff888005b93740 by task kworker/2:1/51 Keep the size of the queue array in the controller and use it instead.
Title nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

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