CVE-2024-40925
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.
At a glance
- Exploitability
- Can be exploited locally on the machine with a low-privilege account. High risk of data exposure, data tampering, service disruption.
- Exploit odds
- 0.3% chance of exploitation in the next 30 days (EPSS).
- Fix
- A patch, advisory or fixed version is referenced. Upgrade or apply it.
Timeline
- PublishedDisclosed publicly on CVE.org and NVD
- Last updatedMost recent change to the record
Why it ranks here
- Exploited in the wild: no, CISA does not list it.
- Exploit odds: 0.3% in the next 30 days (EPSS).
- Severity: 7.8 HIGH (CVSS).
- Fix: a patch or advisory is linked.
Details
- Published
- Last modified
- Exploit probability
- 0.3% · EPSS, next 30 days
- Record status
- Modified
Affected
- Linux Kernel < 6.6.35
- Linux Kernel < 6.9.6
- Linux Kernel 6.10
Attack profile CVSS 3.1 · 7.8
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Raw vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Is it in your code?
Hand this to your coding agent. It searches your project for the affected products and checks versions. Nothing leaves your machine.
Read https://cve-list.com/agent/cve/CVE-2024-40925.md and follow it. Check whether this project is affected by CVE-2024-40925. Read only. Don't change anything and don't upload my code. Tell me yes, no or not sure, with the file as proof.
Fix and advisories
- 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
References
- 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