CVE-2024-42152

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
30/07/2024
Last modified:
03/11/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> nvmet: fix a possible leak when destroy a ctrl during qp establishment<br /> <br /> In nvmet_sq_destroy we capture sq-&gt;ctrl early and if it is non-NULL we<br /> know that a ctrl was allocated (in the admin connect request handler)<br /> and we need to release pending AERs, clear ctrl-&gt;sqs and sq-&gt;ctrl<br /> (for nvme-loop primarily), and drop the final reference on the ctrl.<br /> <br /> However, a small window is possible where nvmet_sq_destroy starts (as<br /> a result of the client giving up and disconnecting) concurrently with<br /> the nvme admin connect cmd (which may be in an early stage). But *before*<br /> kill_and_confirm of sq-&gt;ref (i.e. the admin connect managed to get an sq<br /> live reference). In this case, sq-&gt;ctrl was allocated however after it was<br /> captured in a local variable in nvmet_sq_destroy.<br /> This prevented the final reference drop on the ctrl.<br /> <br /> Solve this by re-capturing the sq-&gt;ctrl after all inflight request has<br /> completed, where for sure sq-&gt;ctrl reference is final, and move forward<br /> based on that.<br /> <br /> This issue was observed in an environment with many hosts connecting<br /> multiple ctrls simoutanuosly, creating a delay in allocating a ctrl<br /> leading up to this race window.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.8 (including) 5.10.222 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.163 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.1.98 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.2 (including) 6.6.39 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.9.9 (excluding)
cpe:2.3:o:linux:linux_kernel:6.10:rc1:*:*:*:*:*:*