VYPR
Unrated severityNVD Advisory· Published Dec 9, 2025· Updated Apr 15, 2026

CVE-2025-40342

CVE-2025-40342

Description

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

nvme-fc: use lock accessing port_state and rport state

nvme_fc_unregister_remote removes the remote port on a lport object at any point in time when there is no active association. This races with with the reconnect logic, because nvme_fc_create_association is not taking a lock to check the port_state and atomically increase the active count on the rport.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

In the Linux kernel's nvme-fc driver, a race condition between remote port removal and association creation can lead to use-after-free or NULL pointer dereference.

Vulnerability

CVE-2025-40342 is a race condition in the Linux kernel's NVMe over Fibre Channel (nvme-fc) driver. The function nvme_fc_unregister_remote can remove a can remove a remote port from a local port object at any time when there is no active association. This removal races with the reconnect logic in nvme_fc_create_association, which does not hold a lock to check the port_state and atomically increment_state and atomically increment the active count on the remote port [1][2].

An attacker with the race, an attacker with local access or the ability to trigger a remote port removal (e.g., through fabric events) could cause the reconnect code to operate on a stale or freed remote port structure. The lack of proper locking means the association creation can proceed after the port has been removed, leading to a use-after-free or NULL pointer dereference or NULL pointer dereference [3][4].

Successful exploitation could result in a kernel crash (denial of service) or potentially arbitrary code execution in the kernel context, depending on the memory layout and attacker control. The vulnerability is present in the Linux kernel versions prior to the fix.

The fix has been applied in the upstream Linux kernel via commits that add proper locking around the port state checks and active count increments. Users should update to a kernel version containing the fix or apply the relevant patches from the stable tree [1][2][3][4].

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2
  • Linux/Kernelinferred2 versions
    (expand)+ 1 more
    • (no CPE)
    • (no CPE)

Patches

7

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.