PT-2026-163256

CVE-2026-139215

·

تاريخ النشر

2026-11-30

·

تاريخ التحديث

2026-11-30

الوصف من

الدرجة
N/A
غير متوفر

لا تتوفر حاليًا تقييمات أو مقاييس للخطورة. سنحدّث المعلومات المقابلة في الصفحة فور توفرها.

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.
المورّدون
المنتجات المتأثرة
المعرّفات ذات الصلة
وجدت خطأً في الوصف؟ لديك ما تضيفه؟ لا تتردد في مراسلتنا 👾