CVE-2024-40925 (GCVE-0-2024-40925)
Vulnerability from cvelistv5
Published
2024-07-12 12:25
Modified
2026-08-05 11:34
Summary
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.
Impacted products
Vendor Product Version
Linux Linux Version: 81ada09cc25e4bf2de7d2951925fb409338a545d
Version: 81ada09cc25e4bf2de7d2951925fb409338a545d
Version: 81ada09cc25e4bf2de7d2951925fb409338a545d
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T04:39:56.086Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/fe1e395563ccb051e9dbd8fa99859f5caaad2e71"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/87907bd69721a8506618a954d41a1de3040e88aa"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/d0321c812d89c5910d8da8e4b10c891c6b96ff70"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-40925",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T17:05:17.851843Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:33:03.370Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "block/blk-flush.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "fe1e395563ccb051e9dbd8fa99859f5caaad2e71",
              "status": "affected",
              "version": "81ada09cc25e4bf2de7d2951925fb409338a545d",
              "versionType": "git"
            },
            {
              "lessThan": "87907bd69721a8506618a954d41a1de3040e88aa",
              "status": "affected",
              "version": "81ada09cc25e4bf2de7d2951925fb409338a545d",
              "versionType": "git"
            },
            {
              "lessThan": "d0321c812d89c5910d8da8e4b10c891c6b96ff70",
              "status": "affected",
              "version": "81ada09cc25e4bf2de7d2951925fb409338a545d",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "block/blk-flush.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.6"
            },
            {
              "lessThan": "6.6",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.35",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.9.*",
              "status": "unaffected",
              "version": "6.9.6",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.10",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.35",
                  "versionStartIncluding": "6.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.9.6",
                  "versionStartIncluding": "6.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.10",
                  "versionStartIncluding": "6.6",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "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(\u0026rq-\u003equeuelist, pending)\"\nin the PREFLUSH/POSTFLUSH sequences. But rq-\u003equeuelist.next == xxx since\nit\u0027s popped out from plug-\u003ecached_rq in __blk_mq_alloc_requests_batch().\nWe don\u0027t 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(\u0026rq-\u003equeuelist, pending)\" so\nrq-\u003equeuelist doesn\u0027t need to be initialized. It should be ok since rq\ncan\u0027t 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-\u003equeuelist 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(\u0026rq-\u003equeuelist)\" 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(\u0026rq-\u003equeuelist)\". The weird invalid format\nproblem should be fixed in dm layer."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerable path is reached only through local I/O submission \u2014 `io_uring_enter(2)` with a multi-SQE batch is the sole caller of `blk_start_plug_nr_ios()`, which is what enables the batched request allocation that leaves `rq-\u003equeuelist` uninitialized. No network protocol handler reaches `blk_mq_get_new_requests()` with `plug-\u003enr_ios \u003e 1`.\nAC:L - No race is involved: the attacker deterministically controls both the io_uring batch size (making `plug-\u003enr_ios \u003e 1`) and the ordering that puts a flush/FUA bio first in the plug, and write-cache-without-FUA queues (dm/LVM, virtio-blk, SATA/SCSI) are the common default. Tag pressure needed to force the NULL-`next` variant is also attacker-generated by keeping the device queue busy.\nPR:L - Any unprivileged local user with io_uring available (default on mainline) and a writable file or block-backed filesystem can submit the required batch; no capability, CAP_SYS_ADMIN, or device-management privilege is needed. A confined container user with a dm-backed overlay qualifies equally.\nUI:N - The attacker triggers the corrupted `list_move_tail()` entirely from their own io_uring submissions; no victim action, mount, or administrator step is required.\nS:U - The corruption and its consequences stay within the host kernel\u0027s own security authority \u2014 kernel heap/list state and block-layer request structures. No hypervisor, IOMMU, or sandbox boundary is crossed by the defect itself.\nC:H - This is real memory corruption, not a bare NULL dereference: `__list_del()` writes a kernel address into a stale `struct request`, and the double-`list_add` on the flush pending list can truncate or loop that list so `flush_end_io()`/`blk_kick_flush()` dereference and re-process requests that have already been ended, yielding use-after-free reads of request/tag state and cross-I/O data exposure into user buffers.\nI:H - The bug gives an uncontrolled kernel-pointer store (`next-\u003eprev = prev`) into a stale `struct request` plus corruption of the flush pending list, which can drive `blk_mq_end_request()` on an already-completed request \u2014 a tag double-free and request reuse, i.e. a use-after-free primitive over block-layer objects with attacker-influenced heap contents and on-disk data written to the wrong request.\nA:H - The originally reported symptom is a kernel crash: the NULL-`next` variant faults at address 0x8 while holding `fq-\u003emq_flush_lock` with interrupts disabled, and the list-corruption variant orphans pending flush requests so their submitters hang in D state forever with tags never released, stalling the whole device queue."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:34:04.175Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/fe1e395563ccb051e9dbd8fa99859f5caaad2e71"
        },
        {
          "url": "https://git.kernel.org/stable/c/87907bd69721a8506618a954d41a1de3040e88aa"
        },
        {
          "url": "https://git.kernel.org/stable/c/d0321c812d89c5910d8da8e4b10c891c6b96ff70"
        }
      ],
      "title": "block: fix request.queuelist usage in flush",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-40925",
    "datePublished": "2024-07-12T12:25:05.747Z",
    "dateReserved": "2024-07-12T12:17:45.582Z",
    "dateUpdated": "2026-08-05T11:34:04.175Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/fe1e395563ccb051e9dbd8fa99859f5caaad2e71\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/87907bd69721a8506618a954d41a1de3040e88aa\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/d0321c812d89c5910d8da8e4b10c891c6b96ff70\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T04:39:56.086Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-40925\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-09-10T17:05:17.851843Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-09-11T12:42:14.278Z\"}}], \"cna\": {\"title\": \"block: fix request.queuelist usage in flush\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"baseScore\": 7.8, \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:L - The vulnerable path is reached only through local I/O submission \\u2014 `io_uring_enter(2)` with a multi-SQE batch is the sole caller of `blk_start_plug_nr_ios()`, which is what enables the batched request allocation that leaves `rq-\u003equeuelist` uninitialized. No network protocol handler reaches `blk_mq_get_new_requests()` with `plug-\u003enr_ios \u003e 1`.\\nAC:L - No race is involved: the attacker deterministically controls both the io_uring batch size (making `plug-\u003enr_ios \u003e 1`) and the ordering that puts a flush/FUA bio first in the plug, and write-cache-without-FUA queues (dm/LVM, virtio-blk, SATA/SCSI) are the common default. Tag pressure needed to force the NULL-`next` variant is also attacker-generated by keeping the device queue busy.\\nPR:L - Any unprivileged local user with io_uring available (default on mainline) and a writable file or block-backed filesystem can submit the required batch; no capability, CAP_SYS_ADMIN, or device-management privilege is needed. A confined container user with a dm-backed overlay qualifies equally.\\nUI:N - The attacker triggers the corrupted `list_move_tail()` entirely from their own io_uring submissions; no victim action, mount, or administrator step is required.\\nS:U - The corruption and its consequences stay within the host kernel\u0027s own security authority \\u2014 kernel heap/list state and block-layer request structures. No hypervisor, IOMMU, or sandbox boundary is crossed by the defect itself.\\nC:H - This is real memory corruption, not a bare NULL dereference: `__list_del()` writes a kernel address into a stale `struct request`, and the double-`list_add` on the flush pending list can truncate or loop that list so `flush_end_io()`/`blk_kick_flush()` dereference and re-process requests that have already been ended, yielding use-after-free reads of request/tag state and cross-I/O data exposure into user buffers.\\nI:H - The bug gives an uncontrolled kernel-pointer store (`next-\u003eprev = prev`) into a stale `struct request` plus corruption of the flush pending list, which can drive `blk_mq_end_request()` on an already-completed request \\u2014 a tag double-free and request reuse, i.e. a use-after-free primitive over block-layer objects with attacker-influenced heap contents and on-disk data written to the wrong request.\\nA:H - The originally reported symptom is a kernel crash: the NULL-`next` variant faults at address 0x8 while holding `fq-\u003emq_flush_lock` with interrupts disabled, and the list-corruption variant orphans pending flush requests so their submitters hang in D state forever with tags never released, stalling the whole device queue.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"81ada09cc25e4bf2de7d2951925fb409338a545d\", \"lessThan\": \"fe1e395563ccb051e9dbd8fa99859f5caaad2e71\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"81ada09cc25e4bf2de7d2951925fb409338a545d\", \"lessThan\": \"87907bd69721a8506618a954d41a1de3040e88aa\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"81ada09cc25e4bf2de7d2951925fb409338a545d\", \"lessThan\": \"d0321c812d89c5910d8da8e4b10c891c6b96ff70\", \"versionType\": \"git\"}], \"programFiles\": [\"block/blk-flush.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.6\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.6\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.6.35\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9.6\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.9.*\"}, {\"status\": \"unaffected\", \"version\": \"6.10\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"block/blk-flush.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/fe1e395563ccb051e9dbd8fa99859f5caaad2e71\"}, {\"url\": \"https://git.kernel.org/stable/c/87907bd69721a8506618a954d41a1de3040e88aa\"}, {\"url\": \"https://git.kernel.org/stable/c/d0321c812d89c5910d8da8e4b10c891c6b96ff70\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"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(\u0026rq-\u003equeuelist, pending)\\\"\\nin the PREFLUSH/POSTFLUSH sequences. But rq-\u003equeuelist.next == xxx since\\nit\u0027s popped out from plug-\u003ecached_rq in __blk_mq_alloc_requests_batch().\\nWe don\u0027t 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(\u0026rq-\u003equeuelist, pending)\\\" so\\nrq-\u003equeuelist doesn\u0027t need to be initialized. It should be ok since rq\\ncan\u0027t 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-\u003equeuelist 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(\u0026rq-\u003equeuelist)\\\" 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(\u0026rq-\u003equeuelist)\\\". The weird invalid format\\nproblem should be fixed in dm layer.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6.35\", \"versionStartIncluding\": \"6.6\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.9.6\", \"versionStartIncluding\": \"6.6\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.10\", \"versionStartIncluding\": \"6.6\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T11:34:04.175Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-40925\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T11:34:04.175Z\", \"dateReserved\": \"2024-07-12T12:17:45.582Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-07-12T12:25:05.747Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…