CVE-2026-23249 (GCVE-0-2026-23249)

Vulnerability from cvelistv5 – Published: 2026-03-18 17:01 – Updated: 2026-03-18 17:01
VLAI?
Title
xfs: check for deleted cursors when revalidating two btrees
Summary
In the Linux kernel, the following vulnerability has been resolved: xfs: check for deleted cursors when revalidating two btrees The free space and inode btree repair functions will rebuild both btrees at the same time, after which it needs to evaluate both btrees to confirm that the corruptions are gone. However, Jiaming Zhang ran syzbot and produced a crash in the second xchk_allocbt call. His root-cause analysis is as follows (with minor corrections): In xrep_revalidate_allocbt(), xchk_allocbt() is called twice (first for BNOBT, second for CNTBT). The cause of this issue is that the first call nullified the cursor required by the second call. Let's first enter xrep_revalidate_allocbt() via following call chain: xfs_file_ioctl() -> xfs_ioc_scrubv_metadata() -> xfs_scrub_metadata() -> `sc->ops->repair_eval(sc)` -> xrep_revalidate_allocbt() xchk_allocbt() is called twice in this function. In the first call: /* Note that sc->sm->sm_type is XFS_SCRUB_TYPE_BNOPT now */ xchk_allocbt() -> xchk_btree() -> `bs->scrub_rec(bs, recp)` -> xchk_allocbt_rec() -> xchk_allocbt_xref() -> xchk_allocbt_xref_other() since sm_type is XFS_SCRUB_TYPE_BNOBT, pur is set to &sc->sa.cnt_cur. Kernel called xfs_alloc_get_rec() and returned -EFSCORRUPTED. Call chain: xfs_alloc_get_rec() -> xfs_btree_get_rec() -> xfs_btree_check_block() -> (XFS_IS_CORRUPT || XFS_TEST_ERROR), the former is false and the latter is true, return -EFSCORRUPTED. This should be caused by ioctl$XFS_IOC_ERROR_INJECTION I guess. Back to xchk_allocbt_xref_other(), after receiving -EFSCORRUPTED from xfs_alloc_get_rec(), kernel called xchk_should_check_xref(). In this function, *curpp (points to sc->sa.cnt_cur) is nullified. Back to xrep_revalidate_allocbt(), since sc->sa.cnt_cur has been nullified, it then triggered null-ptr-deref via xchk_allocbt() (second call) -> xchk_btree(). So. The bnobt revalidation failed on a cross-reference attempt, so we deleted the cntbt cursor, and then crashed when we tried to revalidate the cntbt. Therefore, check for a null cntbt cursor before that revalidation, and mark the repair incomplete. Also we can ignore the second tree entirely if the first tree was rebuilt but is already corrupt. Apply the same fix to xrep_revalidate_iallocbt because it has the same problem.
Severity ?
No CVSS data available.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 , < d69de525bc7ab27713342080bf50826df3f6a68f (git)
Affected: dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 , < b04baa848c0543b240b1bd8aecff470382f6f154 (git)
Affected: dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 , < 5991e96f2ae82df60a3e4ed00f3432d9f3502a99 (git)
Affected: dbfbf3bdf639a20da7d5fb390cd2e197d25aa418 , < 55e03b8cbe2783ec9acfb88e8adb946ed504e117 (git)
Create a notification for this product.
    Linux Linux Affected: 6.8
Unaffected: 0 , < 6.8 (semver)
Unaffected: 6.12.75 , ≤ 6.12.* (semver)
Unaffected: 6.18.16 , ≤ 6.18.* (semver)
Unaffected: 6.19.6 , ≤ 6.19.* (semver)
Unaffected: 7.0-rc1 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/xfs/scrub/alloc_repair.c",
            "fs/xfs/scrub/ialloc_repair.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "d69de525bc7ab27713342080bf50826df3f6a68f",
              "status": "affected",
              "version": "dbfbf3bdf639a20da7d5fb390cd2e197d25aa418",
              "versionType": "git"
            },
            {
              "lessThan": "b04baa848c0543b240b1bd8aecff470382f6f154",
              "status": "affected",
              "version": "dbfbf3bdf639a20da7d5fb390cd2e197d25aa418",
              "versionType": "git"
            },
            {
              "lessThan": "5991e96f2ae82df60a3e4ed00f3432d9f3502a99",
              "status": "affected",
              "version": "dbfbf3bdf639a20da7d5fb390cd2e197d25aa418",
              "versionType": "git"
            },
            {
              "lessThan": "55e03b8cbe2783ec9acfb88e8adb946ed504e117",
              "status": "affected",
              "version": "dbfbf3bdf639a20da7d5fb390cd2e197d25aa418",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/xfs/scrub/alloc_repair.c",
            "fs/xfs/scrub/ialloc_repair.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.8"
            },
            {
              "lessThan": "6.8",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.75",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.16",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.19.*",
              "status": "unaffected",
              "version": "6.19.6",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.0-rc1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.75",
                  "versionStartIncluding": "6.8",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18.16",
                  "versionStartIncluding": "6.8",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.19.6",
                  "versionStartIncluding": "6.8",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.0-rc1",
                  "versionStartIncluding": "6.8",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nxfs: check for deleted cursors when revalidating two btrees\n\nThe free space and inode btree repair functions will rebuild both btrees\nat the same time, after which it needs to evaluate both btrees to\nconfirm that the corruptions are gone.\n\nHowever, Jiaming Zhang ran syzbot and produced a crash in the second\nxchk_allocbt call.  His root-cause analysis is as follows (with minor\ncorrections):\n\n In xrep_revalidate_allocbt(), xchk_allocbt() is called twice (first\n for BNOBT, second for CNTBT). The cause of this issue is that the\n first call nullified the cursor required by the second call.\n\n Let\u0027s first enter xrep_revalidate_allocbt() via following call chain:\n\n xfs_file_ioctl() -\u003e\n xfs_ioc_scrubv_metadata() -\u003e\n xfs_scrub_metadata() -\u003e\n `sc-\u003eops-\u003erepair_eval(sc)` -\u003e\n xrep_revalidate_allocbt()\n\n xchk_allocbt() is called twice in this function. In the first call:\n\n /* Note that sc-\u003esm-\u003esm_type is XFS_SCRUB_TYPE_BNOPT now */\n xchk_allocbt() -\u003e\n xchk_btree() -\u003e\n `bs-\u003escrub_rec(bs, recp)` -\u003e\n xchk_allocbt_rec() -\u003e\n xchk_allocbt_xref() -\u003e\n xchk_allocbt_xref_other()\n\n since sm_type is XFS_SCRUB_TYPE_BNOBT, pur is set to \u0026sc-\u003esa.cnt_cur.\n Kernel called xfs_alloc_get_rec() and returned -EFSCORRUPTED. Call\n chain:\n\n xfs_alloc_get_rec() -\u003e\n xfs_btree_get_rec() -\u003e\n xfs_btree_check_block() -\u003e\n (XFS_IS_CORRUPT || XFS_TEST_ERROR), the former is false and the latter\n is true, return -EFSCORRUPTED. This should be caused by\n ioctl$XFS_IOC_ERROR_INJECTION I guess.\n\n Back to xchk_allocbt_xref_other(), after receiving -EFSCORRUPTED from\n xfs_alloc_get_rec(), kernel called xchk_should_check_xref(). In this\n function, *curpp (points to sc-\u003esa.cnt_cur) is nullified.\n\n Back to xrep_revalidate_allocbt(), since sc-\u003esa.cnt_cur has been\n nullified, it then triggered null-ptr-deref via xchk_allocbt() (second\n call) -\u003e xchk_btree().\n\nSo.  The bnobt revalidation failed on a cross-reference attempt, so we\ndeleted the cntbt cursor, and then crashed when we tried to revalidate\nthe cntbt.  Therefore, check for a null cntbt cursor before that\nrevalidation, and mark the repair incomplete.  Also we can ignore the\nsecond tree entirely if the first tree was rebuilt but is already\ncorrupt.\n\nApply the same fix to xrep_revalidate_iallocbt because it has the same\nproblem."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-03-18T17:01:40.653Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/d69de525bc7ab27713342080bf50826df3f6a68f"
        },
        {
          "url": "https://git.kernel.org/stable/c/b04baa848c0543b240b1bd8aecff470382f6f154"
        },
        {
          "url": "https://git.kernel.org/stable/c/5991e96f2ae82df60a3e4ed00f3432d9f3502a99"
        },
        {
          "url": "https://git.kernel.org/stable/c/55e03b8cbe2783ec9acfb88e8adb946ed504e117"
        }
      ],
      "title": "xfs: check for deleted cursors when revalidating two btrees",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2026-23249",
    "datePublished": "2026-03-18T17:01:40.653Z",
    "dateReserved": "2026-01-13T15:37:45.989Z",
    "dateUpdated": "2026-03-18T17:01:40.653Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2026-23249\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2026-03-18T18:16:22.787\",\"lastModified\":\"2026-03-19T13:25:00.570\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nxfs: check for deleted cursors when revalidating two btrees\\n\\nThe free space and inode btree repair functions will rebuild both btrees\\nat the same time, after which it needs to evaluate both btrees to\\nconfirm that the corruptions are gone.\\n\\nHowever, Jiaming Zhang ran syzbot and produced a crash in the second\\nxchk_allocbt call.  His root-cause analysis is as follows (with minor\\ncorrections):\\n\\n In xrep_revalidate_allocbt(), xchk_allocbt() is called twice (first\\n for BNOBT, second for CNTBT). The cause of this issue is that the\\n first call nullified the cursor required by the second call.\\n\\n Let\u0027s first enter xrep_revalidate_allocbt() via following call chain:\\n\\n xfs_file_ioctl() -\u003e\\n xfs_ioc_scrubv_metadata() -\u003e\\n xfs_scrub_metadata() -\u003e\\n `sc-\u003eops-\u003erepair_eval(sc)` -\u003e\\n xrep_revalidate_allocbt()\\n\\n xchk_allocbt() is called twice in this function. In the first call:\\n\\n /* Note that sc-\u003esm-\u003esm_type is XFS_SCRUB_TYPE_BNOPT now */\\n xchk_allocbt() -\u003e\\n xchk_btree() -\u003e\\n `bs-\u003escrub_rec(bs, recp)` -\u003e\\n xchk_allocbt_rec() -\u003e\\n xchk_allocbt_xref() -\u003e\\n xchk_allocbt_xref_other()\\n\\n since sm_type is XFS_SCRUB_TYPE_BNOBT, pur is set to \u0026sc-\u003esa.cnt_cur.\\n Kernel called xfs_alloc_get_rec() and returned -EFSCORRUPTED. Call\\n chain:\\n\\n xfs_alloc_get_rec() -\u003e\\n xfs_btree_get_rec() -\u003e\\n xfs_btree_check_block() -\u003e\\n (XFS_IS_CORRUPT || XFS_TEST_ERROR), the former is false and the latter\\n is true, return -EFSCORRUPTED. This should be caused by\\n ioctl$XFS_IOC_ERROR_INJECTION I guess.\\n\\n Back to xchk_allocbt_xref_other(), after receiving -EFSCORRUPTED from\\n xfs_alloc_get_rec(), kernel called xchk_should_check_xref(). In this\\n function, *curpp (points to sc-\u003esa.cnt_cur) is nullified.\\n\\n Back to xrep_revalidate_allocbt(), since sc-\u003esa.cnt_cur has been\\n nullified, it then triggered null-ptr-deref via xchk_allocbt() (second\\n call) -\u003e xchk_btree().\\n\\nSo.  The bnobt revalidation failed on a cross-reference attempt, so we\\ndeleted the cntbt cursor, and then crashed when we tried to revalidate\\nthe cntbt.  Therefore, check for a null cntbt cursor before that\\nrevalidation, and mark the repair incomplete.  Also we can ignore the\\nsecond tree entirely if the first tree was rebuilt but is already\\ncorrupt.\\n\\nApply the same fix to xrep_revalidate_iallocbt because it has the same\\nproblem.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/55e03b8cbe2783ec9acfb88e8adb946ed504e117\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/5991e96f2ae82df60a3e4ed00f3432d9f3502a99\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b04baa848c0543b240b1bd8aecff470382f6f154\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d69de525bc7ab27713342080bf50826df3f6a68f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


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 observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…