KernelScan.io

HIGH Introduced in 7.1

unshare Nsproxy UAF

CVE-2026-98983

CVSS 7.0 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: unshare: don't drop active namespace references that were never taken Active references on the namespaces of an nsproxy are taken when the nsproxy is installed into a task in switch_task_namespaces() and copy_namespaces() and dropped again by put_nsproxy() through deactivate_nsproxy(). But ksys_unshare() calls put_nsproxy() on an nsproxy that was never installed when set_cred_ucounts() fails. The new namespaces of that nsproxy go from zero to minus one and the namespaces shared with the caller lose a reference that belongs to the nsproxy the caller keeps using: WARNING: kernel/nscommon.c:171 at __ns_ref_active_put+0x1cd/0x230 nsproxy_ns_active_put deactivate_nsproxy ksys_unshare Afterwards the namespaces the caller lives in aren't listed by listns() anymore. set_cred_ucounts() only fails when alloc_ucounts() can't allocate and it only allocates when the real uid of the caller differs from its effective uid. Commit cefd55bd2159 ("nsproxy: fix free_nsproxy() and simplify create_new_namespaces()") separated the two cases on purpose. nsproxy_free() frees an nsproxy that was prepared but never installed and that's what a failed setns() uses in put_nsset(). Export it and use it for a failed unshare() as well.

02

Engine v0.9.0

Risk summary

A local attacker who can trigger memory allocation failure while holding differing real and effective UIDs can cause a reference count underflow on namespace objects, leading to use-after-free and potential privilege escalation or kernel crash. The vulnerability is reachable via the unshare() syscall without requiring elevated privileges, making it relevant for multi-tenant systems and container hosts.

Affectedkernel/fork.c (unshare syscall), kernel/nsproxy.c (namespace proxy)

Vulnerability analysis

When the unshare() system call fails during credential ucounts allocation — which only occurs when the caller's real UID differs from its effective UID and memory is exhausted — the error path incorrectly calls put_nsproxy() on a namespace proxy that was never installed into a task. This drops active reference counts that were never taken, driving them negative and causing the shared namespaces to be freed while still in use by the calling process. The fix replaces the erroneous put_nsproxy() call with nsproxy_free(), which only releases the regular references appropriate for a never-installed proxy, preserving the active reference counts on the caller's live namespaces.

03

BranchIntroducedFixed inPatch commit
5.155.15.2095.1656fe03a0c05d
6.16.1.1756.20b6f31a3c0b1
6.126.12.916.13—
6.186.18.336.19—
6.66.6.1416.7—
7.07.0.107.1—
7.27.17.2.11—
mainline7.17.3—

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Affected — no CIP fix yet (latest 6.12.118-cip136)
cip/6.1Affected — no CIP fix yet (latest 6.1.190-cip62)
cip/6.1-rtAffected — no CIP fix yet (latest 6.1.189-cip61-rt32)