Skip to main content
Network Thinking Solutions Logo

CVE-2026-139215

In the Linux kernel, the following vulnerability has been resolved: nsproxy: Fix cred leak in the error path of prepare_nsset() A task that calls setns() with CLONE_NEWUSER together with CLONE_NEWNS and at least one more namespace flag leaks a struct cred (and the user_namespace, ucounts and group_info references it holds) whenever the call fails at the fs_struct copy.

All CVEs
CVE-2026-139215Published 11/30/2026

In the Linux kernel, the following vulnerability has been resolved: nsproxy: Fix cred leak in the error path of prepare_nsset() A task that calls setns() with CLONE_NEWUSER together with CLONE_NEWNS and at least one more namespace flag leaks a struct cred (and the user_namespace, ucounts and group_info references it holds) whenever the call fails at the fs_struct copy.

Vendor advisory
CVSS—Unscored

Overview

In the Linux kernel, the following vulnerability has been resolved: nsproxy: Fix cred leak in the error path of prepare_nsset() A task that calls setns() with CLONE_NEWUSER together with CLONE_NEWNS and at least one more namespace flag leaks a struct cred (and the user_namespace, ucounts and group_info references it holds) whenever the call fails at the fs_struct copy. On a kernel with CONFIG_USER_NS the leak is one cred per failed setns(); under memory pressure, or driven by a fault-injecting attacker, it accumulates and pins user namespaces that can then never be freed. prepare_nsset() sets nsset->flags only on the success path: if (flags & CLONE_NEWUSER) nsset->cred = prepare_creds(); ... } else if (flags & CLONE_NEWNS) { nsset->fs = copy_fs_struct(me->fs); if (!nsset->fs) goto out; /* flags still 0 here */ } nsset->flags = flags; return 0; out: put_nsset(nsset); put_nsset() decides what to release from nsset->flags: if (flags & CLONE_NEWUSER) put_cred(nsset_cred(nsset)); On the copy_fs_struct() failure arm prepare_creds() has already allocated the cred, but nsset->flags is still the zero from the caller's "struct nsset nsset = {}", so put_nsset() does not see CLONE_NEWUSER and never drops it. The caller (__do_sys_setns) returns the error without touching nsset, so the cred is lost. Set nsset->flags at the start of prepare_nsset(), before anything can fail, so every error exit through put_nsset() releases what was taken. commit_nsset(), which clears nsset->cred on success, is unaffected. Reproduced on x86_64 under QEMU with failslab aimed at the fs_struct cache and kmemleak enabled: 500 calls of setns(pidfd, CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWUTS) each fail with -ENOMEM and leave 851 unreferenced cred objects allocated from prepare_creds() via setns() before the fix, and none after (the program is in the notes below). Found by formal verification of kernel/nsproxy.c.

Published
11/30/2026
Last modified
11/30/2026
CVE assigner
Linux
NVD analysis
Received

Exploitation

No CISA KEV flag in the saved record

An absent KEV flag does not establish that exploitation has never occurred. Verify current intelligence before prioritizing work.

EPSS predictions and CISA SSVC assessments are not imported here. Review additional intelligence on Cloudflare

Affected products

Affected-version rules published in the advisory. Conditions and uncertain comparisons require verification.

Vendor / productAffected versionsPlatform / conditionsEvidence
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < 85ecdfd12f4a6a2b91479ffe9dd7bd51f21a6f4f

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < 43cbb8cdb829ef735824eff286a3ecd8e5c820e4

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < 6097ae45077b4066e478f898653430c719ec8102

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < 4de99588da937b13ed8fbb92369d19eee969700a

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < 39b61af703ab5beb810edd5ac1f854e6fe3411ba

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < 3ba6455f58f9bd307dc093e177fa302c19ba7da5

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < 09a5a04a2d36c33881e323ddf7d84cf252bf6682

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
≥ 303cc571d107b3641d6487061b748e70ffe15ce4, < e08601d3a7b2236f4915497dca353dcf117bab5c

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
Linux
Linux
5.8

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source

Recommended actions

Verify the product, installed version, platform, and advisory prerequisites on each system. Apply the vendor's applicable fixed release or mitigation. An affected-range boundary alone is not a universal update recommendation.

Vendor advisory links

Derived from non-aggregator references because the source record has no vendor tags. Verify the advisory before acting on it.

Severity

CVSS describes technical impact. It is separate from exploitation evidence.

No CVSS score is published for this record yet. Additional score details appear when the source record is next refreshed.

Sources & references

Sources: Official CVE List, NVD and cve.now (summaries CC BY 4.0). Uses NVD data; not endorsed by NVD.