CVE-2024-40925

CVE-2024-40925

High · published July 12, 2024

CVSS v3.1
7.8
EPSS
0%
Percentile
21.5
In the wild
Unconfirmed
What it is

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

block: fix request.queuelist usage in flush

Friedrich Weber reported a kernel crash problem and bisected to commit

81ada09cc25e ("blk-flush: reuse rq queuelist in flush state machine").

The root cause is that we use "list_move_tail(&rq->queuelist, pending)"

in the PREFLUSH/POSTFLUSH sequences. But rq->queuelist.next == xxx since

it's popped out from plug->cached_rq in __blk_mq_alloc_requests_batch().

We don't initialize its queuelist just for this first request, although

the queuelist of all later popped requests will be initialized.

Fix it by changing to use "list_add_tail(&rq->queuelist, pending)" so

rq->queuelist doesn't need to be initialized. It should be ok since rq

can't be on any list when PREFLUSH or POSTFLUSH, has no move actually.

Please note the commit 81ada09cc25e ("blk-flush: reuse rq queuelist in

flush state machine") also has another requirement that no drivers would

touch rq->queuelist after blk_mq_end_request() since we will reuse it to

add rq to the post-flush pending list in POSTFLUSH. If this is not true,

we will have to revert that commit IMHO.

This updated version adds "list_del_init(&rq->queuelist)" in flush rq

callback since the dm layer may submit request of a weird invalid format

(REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH), which causes double list_add

if without this "list_del_init(&rq->queuelist)". The weird invalid format

problem should be fixed in dm layer.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00300 · 21.5th percentile
Published
2024-07-12T17:15Z
Affected products (5)
ProductVersionsFixed in
linux/linux_kernel≥ 6.6, < 6.6.356.6.35
linux/linux_kernel≥ 6.7, < 6.9.66.9.6
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
References (6)
EPSS history
Timeline
  • 12 JUL 12:25Z
    block: fix request.queuelist usage in flush
    cvelistv5