CVE-2024-40925: block: fix request.queuelist usage in flush

Published Jul 12, 2024
·
Updated

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 "listmovetail(&rq->queuelist, pending)" in the PREFLUSH/POSTFLUSH sequences. But rq->queuelist.next == xxx since it's popped out from plug->cachedrq in blkmqallocrequestsbatch(). 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 "listaddtail(&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 blkmqendrequest() 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 "listdelinit(&rq->queuelist)" in flush rq callback since the dm layer may submit request of a weird invalid format (REQFSEQPREFLUSH | REQFSEQPOSTFLUSH), which causes double listadd if without this "listdelinit(&rq->queuelist)". The weird invalid format problem should be fixed in dm layer.

Affected Software

9 affected componentsFixes available
redhat/kernel<6.6.35
6.6.35
redhat/kernel<6.9.6
6.9.6
redhat/kernel<6.10
6.10
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-1
Linux Linux kernel>=6.6<6.6.35
Linux Linux kernel>=6.7<6.9.6
Linux Linux kernel=6.10-rc1
Linux Linux kernel=6.10-rc2
Linux Linux kernel=6.10-rc3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.6.35
  2. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.9.6
  3. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.10
  4. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch 81ada09cc25e
  6. Configuration

    Apply the kernel change that adds list_del_init(&rq->queuelist) in the flush rq callback, to prevent double list_add caused by the dm layer submitting requests with REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH.

    Linux kernel block layer (blk-flush) list_move_tail(&rq->queuelist, pending) -> list_del_init(&rq->queuelist) in flush rq callback = list_del_init(&rq->queuelist)

Event History

Jul 12, 2024
CVE Published
via MITRE·12:25 PM
Data Sourced
via MITRE·12:25 PM
DescriptionSeverity
Data Sourced
via NVD·01:15 PM
Description
Data Sourced
via NVD·01:15 PM
RemedySeverityAffected Software
Nov 30, 2024
Data Sourced
via Ubuntu·04:44 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-40925?

CVE-2024-40925 has a high severity rating due to its potential to cause system crashes.

2

How do I fix CVE-2024-40925?

To fix CVE-2024-40925, update to the latest kernel version as specified in the affected software details.

3

What systems are affected by CVE-2024-40925?

CVE-2024-40925 affects specific versions of the Linux kernel, including those from Red Hat and Debian.

4

Can CVE-2024-40925 result in data loss?

Yes, the crash caused by CVE-2024-40925 may potentially lead to data loss if not resolved promptly.

5

Is CVE-2024-40925 actively being exploited?

There is no public indication that CVE-2024-40925 is currently being exploited in the wild.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203