{"id":"CVE-2026-98983","summary":"unshare: don't drop active namespace references that were never taken","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nunshare: don't drop active namespace references that were never taken\n\nActive references on the namespaces of an nsproxy are taken when the\nnsproxy is installed into a task in switch_task_namespaces() and\ncopy_namespaces() and dropped again by put_nsproxy() through\ndeactivate_nsproxy().\n\nBut ksys_unshare() calls put_nsproxy() on an nsproxy that was never\ninstalled when set_cred_ucounts() fails. The new namespaces of that\nnsproxy go from zero to minus one and the namespaces shared with the\ncaller lose a reference that belongs to the nsproxy the caller keeps\nusing:\n\n  WARNING: kernel/nscommon.c:171 at __ns_ref_active_put+0x1cd/0x230\n   nsproxy_ns_active_put\n   deactivate_nsproxy\n   ksys_unshare\n\nAfterwards the namespaces the caller lives in aren't listed by listns()\nanymore. set_cred_ucounts() only fails when alloc_ucounts() can't\nallocate and it only allocates when the real uid of the caller differs\nfrom its effective uid.\n\nCommit cefd55bd2159 (\"nsproxy: fix free_nsproxy() and simplify\ncreate_new_namespaces()\") separated the two cases on purpose.\nnsproxy_free() frees an nsproxy that was prepared but never installed\nand that's what a failed setns() uses in put_nsset(). Export it and use\nit for a failed unshare() as well.","modified":"2026-10-28T03:01:49.623470660Z","published":"2026-10-23T12:20:00.918Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98983.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/0b6f31a3c0b16066f812e94b52a704174a6f23cd"},{"type":"WEB","url":"https://git.kernel.org/stable/c/56fe03a0c05dba4c5f6a23c391f96de1614a098c"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98983.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98983"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"a98621a0f187a934c115dcfe79a49520ae892111"},{"fixed":"56fe03a0c05dba4c5f6a23c391f96de1614a098c"},{"fixed":"0b6f31a3c0b16066f812e94b52a704174a6f23cd"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"5.15.209"},{"fixed":"5.16"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"6.1.175"},{"fixed":"6.2"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"6.6.141"},{"fixed":"6.7"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"6.12.91"},{"fixed":"6.13"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"6.18.33"},{"fixed":"6.19"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"7.0.10"},{"fixed":"7.1"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"27ae6b17c9ba7ff353ab0906297f08aa845782b4"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"297261b343371c4f0b31055d53d285138ec21565"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"813a47b0309097da71781ee4ac11922e39b67d55"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"6e608e3e5ce12ce7fd21e46212eccca37f917d0e"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"a261fccdb4ac58ec5ba6aa1d92a6cc418fff301f"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"665dc1ed16357988d439fc5bbc860ee36f540d81"}]}],"versions":["v5.15.223","v5.15.222","v5.15.221","v5.15.220","v5.15.219","v5.15.218","v5.15.217","v5.15.216","v5.15.215","v5.15.214","v5.15.213","v5.15.212","v5.15.211","v5.15.210","v5.15.209","v6.1.190","v6.1.189","v6.1.188","v6.1.187","v6.1.186","v6.1.185","v6.1.184","v6.1.183","v6.1.182","v6.1.181","v6.1.180","v6.1.179","v6.1.178","v6.1.177","v6.1.176","v6.1.175","v6.6.160","v6.6.159","v6.6.158","v6.6.157","v6.6.156","v6.6.155","v6.6.154","v6.6.153","v6.6.152","v6.6.151","v6.6.150","v6.6.149","v6.6.148","v6.6.147","v6.6.146","v6.6.145","v6.6.144","v6.6.143","v6.6.142","v6.6.141","v6.12.114","v6.12.113","v6.12.112","v6.12.111","v6.12.110","v6.12.109","v6.12.108","v6.12.107","v6.12.106","v6.12.105","v6.12.104","v6.12.103","v6.12.102","v6.12.101","v6.12.100","v6.12.99","v6.12.98","v6.12.97","v6.12.96","v6.12.95","v6.12.94","v6.12.93","v6.12.92","v6.12.91","v6.18.59","v6.18.58","v6.18.57","v6.18.56","v6.18.55","v6.18.54","v6.18.53","v6.18.52","v6.18.51","v6.18.50","v6.18.49","v6.18.48","v6.18.47","v6.18.46","v6.18.45","v6.18.44","v6.18.43","v6.18.42","v6.18.41","v6.18.40","v6.18.39","v6.18.38","v6.18.37","v6.18.36","v6.18.35","v6.18.34","v6.18.33","v7.0.14","v7.0.13","v7.0.12","v7.0.11","v7.0.10"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98983.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"7.1.0"},{"fixed":"7.2.11"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98983.json"}}],"schema_version":"1.9.2"}