CVE-2022-48790
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
16/07/2024
Last modified:
07/08/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
nvme: fix a possible use-after-free in controller reset during load<br />
<br />
Unlike .queue_rq, in .submit_async_event drivers may not check the ctrl<br />
readiness for AER submission. This may lead to a use-after-free<br />
condition that was observed with nvme-tcp.<br />
<br />
The race condition may happen in the following scenario:<br />
1. driver executes its reset_ctrl_work<br />
2. -> nvme_stop_ctrl - flushes ctrl async_event_work<br />
3. ctrl sends AEN which is received by the host, which in turn<br />
schedules AEN handling<br />
4. teardown admin queue (which releases the queue socket)<br />
5. AEN processed, submits another AER, calling the driver to submit<br />
6. driver attempts to send the cmd<br />
==> use-after-free<br />
<br />
In order to fix that, add ctrl state check to validate the ctrl<br />
is actually able to accept the AER submission.<br />
<br />
This addresses the above race in controller resets because the driver<br />
during teardown should:<br />
1. change ctrl state to RESETTING<br />
2. flush async_event_work (as well as other async work elements)<br />
<br />
So after 1,2, any other AER command will find the<br />
ctrl state to be RESETTING and bail out without submitting the AER.
Impact
Base Score 3.x
7.00
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.19.231 (excluding) | |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.20 (including) | 5.4.181 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.102 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.25 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 5.16.11 (excluding) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/0ead57ceb21bbf15963b4874c2ac67143455382f
- https://git.kernel.org/stable/c/0fa0f99fc84e41057cbdd2efbfe91c6b2f47dd9d
- https://git.kernel.org/stable/c/70356b756a58704e5c8818cb09da5854af87e765
- https://git.kernel.org/stable/c/9e956a2596ae276124ef0d96829c013dd0faf861
- https://git.kernel.org/stable/c/a25e460fbb0340488d119fb2e28fe3f829b7417e
- https://git.kernel.org/stable/c/e043fb5a0336ee74614e26f0d9f36f1f5bb6d606



