# CVE-2026-89974: nvme-fc: fix double free of fabrics options when nvme\_add\_ctrl() fails

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Adjacent network; Attack complexity: High; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.34% (percentile 20, 2026-11-26)
- **Published:** 2026-09-16T10:32:53.124Z
- **Modified:** 2026-10-19T09:18:44.143Z

## Who should check

- Anyone running Linux \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 8bd14aa065112b4d523bea690027c7527a6224f6; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 5f89d68c00ccd1b25151da0bf660012380c2bad9; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 56e6279266f6962bb2d38a54397e3c605165b0c5
- Anyone running Linux 6.11

## Description

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

nvme-fc: fix double free of fabrics options when nvme\_add\_ctrl() fails

nvmf\_create\_ctrl() owns the fabrics options and frees them whenever
-\>create\_ctrl() returns an error, so a transport must not free them on
its own error paths.  nvme-fc tracks this by testing ctrl-\>ctrl.opts in
nvme\_fc\_ctrl\_free(), which requires nvme\_fc\_init\_ctrl() to clear that
pointer on every error exit.

The coupling is implicit, and commit 1a9e218195a5 ("nvme: split device
add from initialization") broke it by adding a second error exit.  When
nvme\_add\_ctrl() fails, nvme\_fc\_init\_ctrl() jumps to out\_put\_ctrl:, past
the "ctrl-\>ctrl.opts = NULL" that only sits on the fail\_ctrl: path, so
nvme\_fc\_ctrl\_free() frees the options and nvmf\_create\_ctrl() frees them
a second time:

  BUG: KASAN: slab-use-after-free in nvmf\_free\_options+0x30/0x190
   nvmf\_free\_options+0x30/0x190 drivers/nvme/host/fabrics.c:1284
   nvmf\_create\_ctrl drivers/nvme/host/fabrics.c:1374 \[inline\]
  Freed by task 5534:
   nvme\_fc\_ctrl\_free drivers/nvme/host/fc.c:2374 \[inline\]
   nvme\_fc\_init\_ctrl+0xe17/0x1450 drivers/nvme/host/fc.c:3605

nvme\_add\_ctrl() fails when dev\_set\_name() cannot allocate, so this is
reachable under memory pressure or fault injection.  Without KASAN the
options are freed twice.

Rather than clear the pointer on the second exit as well, derive
ownership the way nvme-tcp, nvme-rdma and nvme-loop do, from list
membership: their free\_ctrl leaves the options alone unless the
controller made it onto the transport list.

The list cannot simply be populated on the success path as it is there.
nvme-fc runs the initial connect synchronously via flush\_delayed\_work(),
and the controller has to be reachable on rport-\>ctrl\_list for the whole
of it: nvme\_fc\_unregister\_remoteport() needs to find it to signal
connectivity loss, nvme\_fc\_match\_disconn\_ls() matches an incoming
Disconnect Association LS against ctrl-\>association\_id, which is only
assigned during that window, nvme\_fc\_resume\_controller() needs it on
remoteport re-registration, and nvme\_fc\_existing\_controller() uses it to
reject a duplicate connect racing the one in flight.

Keep the insertion where it is and add a fail\_unlist: label, falling
into fail\_ctrl:, for the error paths that run after it.  The earlier
error paths never reach the insertion and keep using fail\_ctrl:
directly, so the list is only touched where the controller is actually
on it.

nvme\_fc\_ctrl\_free() cannot use the plain "goto free\_ctrl" the other
transports use, because it still has to put\_device(), release the rport
reference and free the ida entry for resources taken before the
insertion.  Sample list\_empty() under rport-\>lock instead.

ctrl-\>ctrl.opts also stays valid for the whole teardown now.  That is
not the bug being fixed, but it removes some fragility around the old
idiom: nvme\_free\_ctrl() calls nvme\_auth\_free() before -\>free\_ctrl(), and
ctrl\_max\_dhchaps() dereferences ctrl-\>opts without a NULL check when
ctrl-\>dhchap\_ctxs is set, which nvme-fc permits since NVMF\_ALLOWED\_OPTS
allows the dhchap options.  The nvme sysfs attributes that dereference
ctrl-\>opts, such as hostnqn and address, evaluate their is\_visible()
test once at device\_add() time and stay readable until
cdev\_device\_del().

## Affected and fixed versions

- Linux: \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 8bd14aa065112b4d523bea690027c7527a6224f6; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 5f89d68c00ccd1b25151da0bf660012380c2bad9; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 56e6279266f6962bb2d38a54397e3c605165b0c5 (cvelist)
- Linux: 6.11 (cvelist)

## Mitigation

- Upgrade Linux to 56e6279266f6962bb2d38a54397e3c605165b0c5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-89974. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-89974.md
Affected: Linux >= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, < 8bd14aa065112b4d523bea690027c7527a6224f6; >= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, < 7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1; >= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, < 5f89d68c00ccd1b25151da0bf660012380c2bad9; >= 1a9e218195a55d0a31e8cbe…
Fixed in: Linux 8bd14aa065112b4d523bea690027c7527a6224f6, Linux 7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1, Linux 5f89d68c00ccd1b25151da0bf660012380c2bad9, Linux 56e6279266f6962bb2d38a54397e3c605165b0c5

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-89974 being exploited?

There is no confirmed exploitation: CVE-2026-89974 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-89974?

High: CVSS 7.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2026-89974?

Linux \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 8bd14aa065112b4d523bea690027c7527a6224f6; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 5f89d68c00ccd1b25151da0bf660012380c2bad9; \>= 1a9e218195a55d0a31e8cbe263aa2f618580ef1d, \< 56e6279266f6962bb2d38a54397e3c605165b0c5; Linux 6.11.

### Is there a fix for CVE-2026-89974?

Yes. Fixed in Linux 8bd14aa065112b4d523bea690027c7527a6224f6, Linux 7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1, Linux 5f89d68c00ccd1b25151da0bf660012380c2bad9, Linux 56e6279266f6962bb2d38a54397e3c605165b0c5. Upgrade Linux to 56e6279266f6962bb2d38a54397e3c605165b0c5 or later.

### How do I check if I'm affected by CVE-2026-89974?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/8bd14aa065112b4d523bea690027c7527a6224f6>
- other: <https://git.kernel.org/stable/c/7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1>
- other: <https://git.kernel.org/stable/c/5f89d68c00ccd1b25151da0bf660012380c2bad9>
- other: <https://git.kernel.org/stable/c/56e6279266f6962bb2d38a54397e3c605165b0c5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-89974>

HTML: <https://flawdb.com/CVE-2026-89974> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-89974>
