CVE-2024-40925
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
12/07/2024
Last modified:
17/09/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
block: fix request.queuelist usage in flush<br />
<br />
Friedrich Weber reported a kernel crash problem and bisected to commit<br />
81ada09cc25e ("blk-flush: reuse rq queuelist in flush state machine").<br />
<br />
The root cause is that we use "list_move_tail(&rq->queuelist, pending)"<br />
in the PREFLUSH/POSTFLUSH sequences. But rq->queuelist.next == xxx since<br />
it&#39;s popped out from plug->cached_rq in __blk_mq_alloc_requests_batch().<br />
We don&#39;t initialize its queuelist just for this first request, although<br />
the queuelist of all later popped requests will be initialized.<br />
<br />
Fix it by changing to use "list_add_tail(&rq->queuelist, pending)" so<br />
rq->queuelist doesn&#39;t need to be initialized. It should be ok since rq<br />
can&#39;t be on any list when PREFLUSH or POSTFLUSH, has no move actually.<br />
<br />
Please note the commit 81ada09cc25e ("blk-flush: reuse rq queuelist in<br />
flush state machine") also has another requirement that no drivers would<br />
touch rq->queuelist after blk_mq_end_request() since we will reuse it to<br />
add rq to the post-flush pending list in POSTFLUSH. If this is not true,<br />
we will have to revert that commit IMHO.<br />
<br />
This updated version adds "list_del_init(&rq->queuelist)" in flush rq<br />
callback since the dm layer may submit request of a weird invalid format<br />
(REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH), which causes double list_add<br />
if without this "list_del_init(&rq->queuelist)". The weird invalid format<br />
problem should be fixed in dm layer.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.6 (including) | 6.6.35 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.9.6 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.10:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc3:*:*:*:*:*:* |
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/87907bd69721a8506618a954d41a1de3040e88aa
- https://git.kernel.org/stable/c/d0321c812d89c5910d8da8e4b10c891c6b96ff70
- https://git.kernel.org/stable/c/fe1e395563ccb051e9dbd8fa99859f5caaad2e71
- https://git.kernel.org/stable/c/87907bd69721a8506618a954d41a1de3040e88aa
- https://git.kernel.org/stable/c/d0321c812d89c5910d8da8e4b10c891c6b96ff70
- https://git.kernel.org/stable/c/fe1e395563ccb051e9dbd8fa99859f5caaad2e71



