CVE-2025-38659 (GCVE-0-2025-38659)
Vulnerability from cvelistv5
Published
2025-08-22 16:01
Modified
2026-08-05 12:03
Summary
In the Linux kernel, the following vulnerability has been resolved: gfs2: No more self recovery When a node withdraws and it turns out that it is the only node that has the filesystem mounted, gfs2 currently tries to replay the local journal to bring the filesystem back into a consistent state. Not only is that a very bad idea, it has also never worked because gfs2_recover_func() will refuse to do anything during a withdraw. However, before even getting to this point, gfs2_recover_func() dereferences sdp->sd_jdesc->jd_inode. This was a use-after-free before commit 04133b607a78 ("gfs2: Prevent double iput for journal on error") and is a NULL pointer dereference since then. Simply get rid of self recovery to fix that.
Impacted products
Vendor Product Version
Linux Linux Version: 601ef0d52e9617588fcff3df26953592f2eb44ac
Version: 601ef0d52e9617588fcff3df26953592f2eb44ac
Version: 601ef0d52e9617588fcff3df26953592f2eb44ac
Version: 601ef0d52e9617588fcff3df26953592f2eb44ac
Version: 601ef0d52e9617588fcff3df26953592f2eb44ac
Version: 601ef0d52e9617588fcff3df26953592f2eb44ac
Version: 601ef0d52e9617588fcff3df26953592f2eb44ac
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/gfs2/util.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "69cf5699a402ee7ae1be53954dc2ae652c0a053c",
              "status": "affected",
              "version": "601ef0d52e9617588fcff3df26953592f2eb44ac",
              "versionType": "git"
            },
            {
              "lessThan": "6ebe17b359bead383581f729e43f591c1c36e159",
              "status": "affected",
              "version": "601ef0d52e9617588fcff3df26953592f2eb44ac",
              "versionType": "git"
            },
            {
              "lessThan": "1a91ba12abef628b43cada87478328274d988e88",
              "status": "affected",
              "version": "601ef0d52e9617588fcff3df26953592f2eb44ac",
              "versionType": "git"
            },
            {
              "lessThan": "f5426ffbec971a8f7346a57392d3a901bdee5a9b",
              "status": "affected",
              "version": "601ef0d52e9617588fcff3df26953592f2eb44ac",
              "versionType": "git"
            },
            {
              "lessThan": "6784367b2f3cd7b89103de35764f37f152590dbd",
              "status": "affected",
              "version": "601ef0d52e9617588fcff3df26953592f2eb44ac",
              "versionType": "git"
            },
            {
              "lessThan": "97c94c7dbddc34d353c83b541b3decabf98d04af",
              "status": "affected",
              "version": "601ef0d52e9617588fcff3df26953592f2eb44ac",
              "versionType": "git"
            },
            {
              "lessThan": "deb016c1669002e48c431d6fd32ea1c20ef41756",
              "status": "affected",
              "version": "601ef0d52e9617588fcff3df26953592f2eb44ac",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/gfs2/util.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.7"
            },
            {
              "lessThan": "5.7",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.209",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.167",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.102",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.42",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.15.*",
              "status": "unaffected",
              "version": "6.15.10",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.16.*",
              "status": "unaffected",
              "version": "6.16.1",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.17",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.209",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.167",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.102",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.42",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15.10",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16.1",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17",
                  "versionStartIncluding": "5.7",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ngfs2: No more self recovery\n\nWhen a node withdraws and it turns out that it is the only node that has\nthe filesystem mounted, gfs2 currently tries to replay the local journal\nto bring the filesystem back into a consistent state.  Not only is that\na very bad idea, it has also never worked because gfs2_recover_func()\nwill refuse to do anything during a withdraw.\n\nHowever, before even getting to this point, gfs2_recover_func()\ndereferences sdp-\u003esd_jdesc-\u003ejd_inode.  This was a use-after-free before\ncommit 04133b607a78 (\"gfs2: Prevent double iput for journal on error\")\nand is a NULL pointer dereference since then.\n\nSimply get rid of self recovery to fix that."
        }
      ],
      "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 - GFS2 is a shared-disk cluster filesystem; the vulnerable path is entered from local VFS operations (read/lookup/getxattr/write) on a mounted filesystem or from block-device I/O errors, not from any network protocol handler. No remote peer data reaches `signal_our_withdraw()` or `gfs2_recover_func()`.\nAC:L - The trigger is deterministic, not a race \u2014 crafted or damaged on-disk metadata reliably drives one of the ~90 `gfs2_consist*`/`gfs2_assert_withdraw()` sites into a withdraw, and the \"only mounter\" condition holds by construction on the single-node/last-surviving-node deployments GFS2 commonly runs in. The 200 ms `msleep(GL_GLOCK_MAX_HOLD)` plus DLM round trip between `iput()` and `gfs2_recover_journal()` gives an enormous, reliably winnable window to reclaim the freed inode via inode spraying on any gfs2 mount.\nPR:L - Once the filesystem is mounted, an ordinary unprivileged local user with access to it can force the withdraw through plain directory reads, xattr reads, block allocation, or file I/O \u2014 the consistency-check sites in `dir.c`, `xattr.c`, `rgrp.c`, and `bmap.c` are all reachable from unprivileged syscalls. Only the mount and the sysfs withdraw knob are privileged, and neither is required for this path, so between L and H the higher-severity Low applies.\nUI:N - In a cluster deployment the GFS2 filesystem is already mounted as the steady state, so no victim action is needed \u2014 the attacker simply operates on it, or a latent metadata/media error withdraws it spontaneously. The withdraw and subsequent self-recovery execute automatically with no interaction.\nS:U - The dangling-pointer dereference, the corrupted kernel objects, and the resulting hang are all confined to the kernel\u0027s own security authority on the affected host. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - On the affected 5.7\u20136.0 and 5.15.y kernels this is a use-after-free \u2014 `gfs2_recover_func()` reads `jd_inode-\u003ei_sb-\u003es_fs_info` and `ip-\u003ei_gl` out of an inode already freed to `gfs2_inode_cachep`, so contents of a reclaimed slab object are interpreted as a `gfs2_sbd` and a glock and then read through by the glock and journal-replay code. That yields a controllable kernel-memory read primitive, well beyond a bounded leak.\nI:H - The freed inode supplies both the `sdp` superblock pointer and the `i_gl` glock pointer that are subsequently passed to `gfs2_glock_nq_init()` and the `foreach_descriptor()`/`clean_journal()` replay path, which write through them into kernel memory and onto disk. A use-after-free with an attacker-shapeable object of this size is exploitable for heap grooming and control-flow-relevant writes.\nA:H - On post-6.1 kernels this is an outright NULL dereference oops in the `gfs2_recovery_wq` worker, which dies before clearing `JDF_RECOVERY`, leaving the withdrawing task permanently stuck in an uninterruptible `wait_on_bit()`, the recovery workqueue wedged, and the filesystem impossible to unmount. Combined with the UAF-induced corruption on older kernels and a hard panic under `panic_on_oops`, availability loss is total."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:03:46.132Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/69cf5699a402ee7ae1be53954dc2ae652c0a053c"
        },
        {
          "url": "https://git.kernel.org/stable/c/6ebe17b359bead383581f729e43f591c1c36e159"
        },
        {
          "url": "https://git.kernel.org/stable/c/1a91ba12abef628b43cada87478328274d988e88"
        },
        {
          "url": "https://git.kernel.org/stable/c/f5426ffbec971a8f7346a57392d3a901bdee5a9b"
        },
        {
          "url": "https://git.kernel.org/stable/c/6784367b2f3cd7b89103de35764f37f152590dbd"
        },
        {
          "url": "https://git.kernel.org/stable/c/97c94c7dbddc34d353c83b541b3decabf98d04af"
        },
        {
          "url": "https://git.kernel.org/stable/c/deb016c1669002e48c431d6fd32ea1c20ef41756"
        }
      ],
      "title": "gfs2: No more self recovery",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38659",
    "datePublished": "2025-08-22T16:01:02.448Z",
    "dateReserved": "2025-04-16T04:51:24.031Z",
    "dateUpdated": "2026-08-05T12:03:46.132Z",
    "state": "PUBLISHED"
  },
  "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…