# CVE-2024-42152: nvmet: fix a possible leak when destroy a ctrl during qp establishment

- Priority: **Prioritise**
- Reason: Severe, CVSS 7.5 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2024-07-30 · Modified: 2026-08-05
- Aliases: UBUNTU-CVE-2024-42152, DEBIAN-CVE-2024-42152
- Record: https://cvemate.com/vulnerability/CVE-2024-42152 · JSON: https://cvemate.com/vulnerability/CVE-2024-42152/json

## Description

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

nvmet: fix a possible leak when destroy a ctrl during qp establishment

In nvmet_sq_destroy we capture sq->ctrl early and if it is non-NULL we
know that a ctrl was allocated (in the admin connect request handler)
and we need to release pending AERs, clear ctrl->sqs and sq->ctrl
(for nvme-loop primarily), and drop the final reference on the ctrl.

However, a small window is possible where nvmet_sq_destroy starts (as
a result of the client giving up and disconnecting) concurrently with
the nvme admin connect cmd (which may be in an early stage). But *before*
kill_and_confirm of sq->ref (i.e. the admin connect managed to get an sq
live reference). In this case, sq->ctrl was allocated however after it was
captured in a local variable in nvmet_sq_destroy.
This prevented the final reference drop on the ctrl.

Solve this by re-capturing the sq->ctrl after all inflight request has
completed, where for sure sq->ctrl reference is final, and move forward
based on that.

This issue was observed in an environment with many hosts connecting
multiple ctrls simoutanuosly, creating a delay in allocating a ctrl
leading up to this race window.
```

## Signals

- CVSS: 7.5 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.739%, percentile 55.924%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 121)

- debian linux (Debian): \< 6.1.98-1 \| \< 6.9.9-1
- ubuntu linux (Ubuntu): \< 5.15.0-121.131 \| \< 6.8.0-48.48
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 5.15.0-1069.75 \| \< 6.8.0-1018.20
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1069.75~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1018.19~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1069.75+fips1
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1072.81 \| \< 6.8.0-1017.20
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.15 (Ubuntu): \< 5.15.0-1072.81~20.04.1
- ubuntu linux-azure-5.19 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 28)

- <https://git.kernel.org/stable/c/2f3c22b1d3d7e86712253244797a651998c141fa>
- <https://git.kernel.org/stable/c/b4fed1443a6571d49c6ffe7d97af3bbe5ee6dff5>
- <https://git.kernel.org/stable/c/940a71f08ef153ef807f751310b0648d1fa5d0da>
- <https://git.kernel.org/stable/c/5502c1f1d0d7472706cc1f201aecf1c935d302d1>
- <https://git.kernel.org/stable/c/818004f2a380420c19872171be716174d4985e33>
- <https://git.kernel.org/stable/c/c758b77d4a0a0ed3a1292b3fd7a2aeccd1a169a4>
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- <https://ubuntu.com/security/CVE-2024-42152>
- <https://www.cve.org/CVERecord?id=CVE-2024-42152>
- <https://git.kernel.org/linus/c758b77d4a0a0ed3a1292b3fd7a2aeccd1a169a4>
- <https://ubuntu.com/security/notices/USN-7007-1>
- <https://ubuntu.com/security/notices/USN-7009-1>
- <https://ubuntu.com/security/notices/USN-7019-1>
- <https://ubuntu.com/security/notices/USN-7007-2>
- <https://ubuntu.com/security/notices/USN-7007-3>
- <https://ubuntu.com/security/notices/USN-7009-2>
- <https://ubuntu.com/security/notices/USN-7089-1>
- <https://ubuntu.com/security/notices/USN-7090-1>
- <https://ubuntu.com/security/notices/USN-7089-2>
- <https://ubuntu.com/security/notices/USN-7089-3>

---

Data as of 2026-12-05T09:19:24.734Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
