{"id":"CVE-2024-40925","aliases":["CVE-2024-40925"],"related":[],"kind":"vulnerability","state":"published","title":"block: fix request.queuelist usage in flush","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nblock: fix request.queuelist usage in flush\n\nFriedrich Weber reported a kernel crash problem and bisected to commit\n81ada09cc25e (\"blk-flush: reuse rq queuelist in flush state machine\").\n\nThe root cause is that we use \"list_move_tail(&rq->queuelist, pending)\"\nin the PREFLUSH/POSTFLUSH sequences. But rq->queuelist.next == xxx since\nit's popped out from plug->cached_rq in __blk_mq_alloc_requests_batch().\nWe don't initialize its queuelist just for this first request, although\nthe queuelist of all later popped requests will be initialized.\n\nFix it by changing to use \"list_add_tail(&rq->queuelist, pending)\" so\nrq->queuelist doesn't need to be initialized. It should be ok since rq\ncan't be on any list when PREFLUSH or POSTFLUSH, has no move actually.\n\nPlease note the commit 81ada09cc25e (\"blk-flush: reuse rq queuelist in\nflush state machine\") also has another requirement that no drivers would\ntouch rq->queuelist after blk_mq_end_request() since we will reuse it to\nadd rq to the post-flush pending list in POSTFLUSH. If this is not true,\nwe will have to revert that commit IMHO.\n\nThis updated version adds \"list_del_init(&rq->queuelist)\" in flush rq\ncallback since the dm layer may submit request of a weird invalid format\n(REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH), which causes double list_add\nif without this \"list_del_init(&rq->queuelist)\". The weird invalid format\nproblem should be fixed in dm layer.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nblock: fix request.queuelist usage in flush\n\nFriedrich Weber reported a kernel crash problem and bisected to commit\n81ada09cc25e (\"blk-flush: reuse rq queuelist in flush state machine\").\n\nThe root cause is that we use \"list_move_tail(&rq->queuelist, pending)\"\nin the PREFLUSH/POSTFLUSH sequences. But rq->queuelist.next == xxx since\nit's popped out from plug->cached_rq in __blk_mq_alloc_requests_batch().\nWe don't initialize its queuelist just for this first request, although\nthe queuelist of all later popped requests will be initialized.\n\nFix it by changing to use \"list_add_tail(&rq->queuelist, pending)\" so\nrq->queuelist doesn't need to be initialized. It should be ok since rq\ncan't be on any list when PREFLUSH or POSTFLUSH, has no move actually.\n\nPlease note the commit 81ada09cc25e (\"blk-flush: reuse rq queuelist in\nflush state machine\") also has another requirement that no drivers would\ntouch rq->queuelist after blk_mq_end_request() since we will reuse it to\nadd rq to the post-flush pending list in POSTFLUSH. If this is not true,\nwe will have to revert that commit IMHO.\n\nThis updated version adds \"list_del_init(&rq->queuelist)\" in flush rq\ncallback since the dm layer may submit request of a weird invalid format\n(REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH), which causes double list_add\nif without this \"list_del_init(&rq->queuelist)\". The weird invalid format\nproblem should be fixed in dm layer.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se resolvió la siguiente vulnerabilidad: bloque: corrige el uso de request.queuelist en Flush Friedrich Weber informó un problema de falla del kernel y lo bisecó para el commit 81ada09cc25e (\"blk-flush: reutilizar rq queuelist en la máquina de estado de descarga\"). La causa principal es que usamos \"list_move_tail(&amp;rq-&gt;queuelist, pendiente)\" en las secuencias PREFLUSH/POSTFLUSH. Pero rq-&gt;queuelist.next == xxx ya que salió del plug-&gt;cached_rq en __blk_mq_alloc_requests_batch(). No inicializamos su lista de colas solo para esta primera solicitud, aunque se inicializará la lista de colas de todas las solicitudes emergentes posteriores. Solucionelo cambiando para usar \"list_add_tail(&amp;rq-&gt;queuelist, pendiente)\" para que no sea necesario inicializar rq-&gt;queuelist. Debería estar bien ya que rq no puede estar en ninguna lista cuando PREFLUSH o POSTFLUSH, en realidad no tiene movimiento. Tenga en cuenta que el commit 81ada09cc25e (\"blk-flush: reutilizar rq queuelist en la máquina de estado de descarga\") también tiene otro requisito de que ningún controlador toque rq-&gt;queuelist después de blk_mq_end_request() ya que lo reutilizaremos para agregar rq al post-flush lista pendiente en POSTFLUSH. Si esto no es cierto, tendremos que revertir ese commit en mi humilde opinión. Esta versión actualizada agrega \"list_del_init(&amp;rq-&gt;queuelist)\" en la devolución de llamada de Flush rq ya que la capa dm puede enviar una solicitud de un formato extraño no válido (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH), lo que provoca el doble list_add si no se tiene este \"list_del_init(&amp;rq-&gt;queuelist) \". El extraño problema del formato no válido debería solucionarse en la capa dm.","source":"nvd"}],"published":"2024-07-12T12:25:05.747Z","modified":"2026-08-05T11:34:04.175Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"81ada09cc25e4bf2de7d2951925fb409338a545d","fixed":"fe1e395563ccb051e9dbd8fa99859f5caaad2e71","status":"affected"},{"type":"git","introduced":"81ada09cc25e4bf2de7d2951925fb409338a545d","fixed":"87907bd69721a8506618a954d41a1de3040e88aa","status":"affected"},{"type":"git","introduced":"81ada09cc25e4bf2de7d2951925fb409338a545d","fixed":"d0321c812d89c5910d8da8e4b10c891c6b96ff70","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.6","status":"unaffected"},{"type":"semver","introduced":"6.6.35","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.9.6","lastAffected":"6.9.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.10","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.6","fixed":"6.6.35"},{"status":"affected","introduced":"6.7","fixed":"6.9.6"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/fe1e395563ccb051e9dbd8fa99859f5caaad2e71","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/87907bd69721a8506618a954d41a1de3040e88aa","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d0321c812d89c5910d8da8e4b10c891c6b96ff70","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-10T17:05:17.851Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-40925","url":"https://www.cve.org/CVERecord?id=CVE-2024-40925","licence":"CVE Terms of Use","modified":"2026-08-05T11:34:04.175Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-40925","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40925","licence":"Public domain","modified":"2026-08-04T11:19:06.287Z"}],"updatedAt":"2026-11-25T22:58:42.842Z","epss":{"score":0.003,"percentile":0.24424,"date":"2026-12-01T12:00:22.000Z"}}