CVE-2025-40203 (GCVE-0-2025-40203)
Vulnerability from cvelistv5
Published
2025-11-12 21:56
Modified
2026-08-05 12:08
Summary
In the Linux kernel, the following vulnerability has been resolved: listmount: don't call path_put() under namespace semaphore Massage listmount() and make sure we don't call path_put() under the namespace semaphore. If we put the last reference we're fscked.
Impacted products
Vendor Product Version
Linux Linux Version: b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d
Version: b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d
Version: b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/namespace.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "659874b7ee4976ad9ce476e07fd36bc67b3537f1",
              "status": "affected",
              "version": "b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d",
              "versionType": "git"
            },
            {
              "lessThan": "9c80da26fda2fdcaac7f92b5908875b3108830ff",
              "status": "affected",
              "version": "b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d",
              "versionType": "git"
            },
            {
              "lessThan": "c1f86d0ac322c7e77f6f8dbd216c65d39358ffc0",
              "status": "affected",
              "version": "b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/namespace.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.54",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.54",
                  "versionStartIncluding": "6.8",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.4",
                  "versionStartIncluding": "6.8",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18",
                  "versionStartIncluding": "6.8",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nlistmount: don\u0027t call path_put() under namespace semaphore\n\nMassage listmount() and make sure we don\u0027t call path_put() under the\nnamespace semaphore. If we put the last reference we\u0027re fscked."
        }
      ],
      "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 vulnerability is reached only through the `listmount(2)` system call in fs/namespace.c; there is no remote or adjacent-network path to `do_listmount()`. Exploitation requires the ability to execute syscalls on the target, i.e. local access.\nAC:L - The attacker controls both sides of the race \u2014 it holds the extra path reference via `listmount()` while a `CLONE_FS` sibling thread moves `fs-\u003eroot` off a lazily-unmounted mount, deterministically making the in-syscall `path_put()` the final reference. The setup (unshare, tmpfs mount, chroot, `umount2(MNT_DETACH)`) is scripted and retryable without limit.\nPR:L - `listmount(2)` requires no capability at all for the caller\u0027s own mount namespace, and the mount/chroot/lazy-umount setup is obtainable by any unprivileged user via `unshare -Ur` since CAP_SYS_ADMIN/CAP_SYS_CHROOT are granted inside a user namespace. No real root in the init namespace is needed.\nUI:N - The attacking process performs every step itself \u2014 namespace creation, mount setup, and the concurrent `listmount()`/`chroot()` race. No victim action or cooperation is involved.\nS:U - The corrupted state (`struct mount`, `struct mountpoint`, `struct dentry`, `namespace_sem`) and the resulting impact all live within the kernel\u0027s own security authority. No hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - The final `mntput_no_expire()` tears down mounts, frees `struct mountpoint`, and destroys dentries/inodes while only the read side of `namespace_sem` is held, so concurrent readers (other `listmount()`/`statmount()`/propagation walkers that legitimately hold the read lock and expect a stable topology) can traverse freed objects \u2014 a use-after-free giving an attacker-influenceable kernel-memory read primitive via slab reuse.\nI:H - The same violated invariant permits mount-tree list surgery (`list_del(\u0026mnt-\u003emnt_instance)`, `unhash_mnt()`, child reparenting) to race concurrent read-side traversal, yielding linked-list corruption and use-after-free writes into reallocated slab objects, which is exploitable for control-flow hijacking.\nA:H - Performing the final `path_put()` under `namespace_sem` can block or self-deadlock \u2014 inode eviction can stall indefinitely on a userspace filesystem daemon, and `__detach_mounts()`\u0027s `down_write(\u0026namespace_sem)` on an already read-held semaphore deadlocks \u2014 hanging every mount, umount, statmount, and listmount on the system; the same UAF also reliably oopses the kernel."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:08:32.046Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/659874b7ee4976ad9ce476e07fd36bc67b3537f1"
        },
        {
          "url": "https://git.kernel.org/stable/c/9c80da26fda2fdcaac7f92b5908875b3108830ff"
        },
        {
          "url": "https://git.kernel.org/stable/c/c1f86d0ac322c7e77f6f8dbd216c65d39358ffc0"
        }
      ],
      "title": "listmount: don\u0027t call path_put() under namespace semaphore",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40203",
    "datePublished": "2025-11-12T21:56:34.801Z",
    "dateReserved": "2025-04-16T07:20:57.179Z",
    "dateUpdated": "2026-08-05T12:08:32.046Z",
    "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…