{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2025-40203", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2025-04-16T07:20:57.179Z", "datePublished": "2025-11-12T21:56:34.801Z", "dateUpdated": "2026-08-05T12:08:32.046Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T12:08:32.046Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nlistmount: don't call path_put() under namespace semaphore\n\nMassage listmount() and make sure we don't call path_put() under the\nnamespace semaphore. If we put the last reference we're fscked." } ], "metrics": [ { "cvssV3_1": { "version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH" }, "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 — it holds the extra path reference via `listmount()` while a `CLONE_FS` sibling thread moves `fs->root` 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's 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 — 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's 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 — 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(&mnt->mnt_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 — inode eviction can stall indefinitely on a userspace filesystem daemon, and `__detach_mounts()`'s `down_write(&namespace_sem)` on an already read-held semaphore deadlocks — hanging every mount, umount, statmount, and listmount on the system; the same UAF also reliably oopses the kernel." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "fs/namespace.c" ], "versions": [ { "version": "b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d", "lessThan": "659874b7ee4976ad9ce476e07fd36bc67b3537f1", "status": "affected", "versionType": "git" }, { "version": "b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d", "lessThan": "9c80da26fda2fdcaac7f92b5908875b3108830ff", "status": "affected", "versionType": "git" }, { "version": "b4c2bea8ceaa50cd42a8f73667389d801a3ecf2d", "lessThan": "c1f86d0ac322c7e77f6f8dbd216c65d39358ffc0", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "fs/namespace.c" ], "versions": [ { "version": "6.8", "status": "affected" }, { "version": "0", "lessThan": "6.8", "status": "unaffected", "versionType": "semver" }, { "version": "6.12.54", "lessThanOrEqual": "6.12.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.17.4", "lessThanOrEqual": "6.17.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.18", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.8", "versionEndExcluding": "6.12.54" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.8", "versionEndExcluding": "6.17.4" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.8", "versionEndExcluding": "6.18" } ] } ] } ], "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't call path_put() under namespace semaphore", "x_generator": { "engine": "bippy-1.2.0" } } } }