{"id":"CVE-2026-43472","aliases":["CVE-2026-43472"],"related":[],"kind":"vulnerability","state":"published","title":"unshare: fix unshare_fs() handling","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nunshare: fix unshare_fs() handling\n\nThere's an unpleasant corner case in unshare(2), when we have a\nCLONE_NEWNS in flags and current->fs hadn't been shared at all; in that\ncase copy_mnt_ns() gets passed current->fs instead of a private copy,\nwhich causes interesting warts in proof of correctness]\n\n> I guess if private means fs->users == 1, the condition could still be true.\n\nUnfortunately, it's worse than just a convoluted proof of correctness.\nConsider the case when we have CLONE_NEWCGROUP in addition to CLONE_NEWNS\n(and current->fs->users == 1).\n\nWe pass current->fs to copy_mnt_ns(), all right.  Suppose it succeeds and\nflips current->fs->{pwd,root} to corresponding locations in the new namespace.\nNow we proceed to copy_cgroup_ns(), which fails (e.g. with -ENOMEM).\nWe call put_mnt_ns() on the namespace created by copy_mnt_ns(), it's\ndestroyed and its mount tree is dissolved, but...  current->fs->root and\ncurrent->fs->pwd are both left pointing to now detached mounts.\n\nThey are pinning those, so it's not a UAF, but it leaves the calling\nprocess with unshare(2) failing with -ENOMEM _and_ leaving it with\npwd and root on detached isolated mounts.  The last part is clearly a bug.\n\nThere is other fun related to that mess (races with pivot_root(), including\nthe one between pivot_root() and fork(), of all things), but this one\nis easy to isolate and fix - treat CLONE_NEWNS as \"allocate a new\nfs_struct even if it hadn't been shared in the first place\".  Sure, we could\ngo for something like \"if both CLONE_NEWNS *and* one of the things that might\nend up failing after copy_mnt_ns() call in create_new_namespaces() are set,\nforce allocation of new fs_struct\", but let's keep it simple - the cost\nof copy_fs_struct() is trivial.\n\nAnother benefit is that copy_mnt_ns() with CLONE_NEWNS *always* gets\na freshly allocated fs_struct, yet to be attached to anything.  That\nseriously simplifies the analysis...\n\nFWIW, that bug had been there since the introduction of unshare(2) ;-/","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nunshare: fix unshare_fs() handling\n\nThere's an unpleasant corner case in unshare(2), when we have a\nCLONE_NEWNS in flags and current->fs hadn't been shared at all; in that\ncase copy_mnt_ns() gets passed current->fs instead of a private copy,\nwhich causes interesting warts in proof of correctness]\n\n> I guess if private means fs->users == 1, the condition could still be true.\n\nUnfortunately, it's worse than just a convoluted proof of correctness.\nConsider the case when we have CLONE_NEWCGROUP in addition to CLONE_NEWNS\n(and current->fs->users == 1).\n\nWe pass current->fs to copy_mnt_ns(), all right.  Suppose it succeeds and\nflips current->fs->{pwd,root} to corresponding locations in the new namespace.\nNow we proceed to copy_cgroup_ns(), which fails (e.g. with -ENOMEM).\nWe call put_mnt_ns() on the namespace created by copy_mnt_ns(), it's\ndestroyed and its mount tree is dissolved, but...  current->fs->root and\ncurrent->fs->pwd are both left pointing to now detached mounts.\n\nThey are pinning those, so it's not a UAF, but it leaves the calling\nprocess with unshare(2) failing with -ENOMEM _and_ leaving it with\npwd and root on detached isolated mounts.  The last part is clearly a bug.\n\nThere is other fun related to that mess (races with pivot_root(), including\nthe one between pivot_root() and fork(), of all things), but this one\nis easy to isolate and fix - treat CLONE_NEWNS as \"allocate a new\nfs_struct even if it hadn't been shared in the first place\".  Sure, we could\ngo for something like \"if both CLONE_NEWNS *and* one of the things that might\nend up failing after copy_mnt_ns() call in create_new_namespaces() are set,\nforce allocation of new fs_struct\", but let's keep it simple - the cost\nof copy_fs_struct() is trivial.\n\nAnother benefit is that copy_mnt_ns() with CLONE_NEWNS *always* gets\na freshly allocated fs_struct, yet to be attached to anything.  That\nseriously simplifies the analysis...\n\nFWIW, that bug had been there since the introduction of unshare(2) ;-/","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nunshare: corrección del manejo de unshare_fs()\n\nExiste un caso límite desagradable en unshare(2), cuando tenemos un CLONE_NEWNS en flags y current  ->  fs no había sido compartido en absoluto; en ese caso, a copy_mnt_ns() se le pasa current  ->  fs en lugar de una copia privada, lo que causa imperfecciones interesantes en la prueba de corrección]\n\n> Supongo que si ’privado’ significa fs  ->  users == 1, la condición aún podría ser verdadera.\n\nDesafortunadamente, es peor que solo una prueba de corrección enrevesada. Considere el caso en que tenemos CLONE_NEWCGROUP además de CLONE_NEWNS (y current  ->  fs  ->  users == 1).\n\nPasamos current  ->  fs a copy_mnt_ns(), de acuerdo. Supongamos que tiene éxito y cambia current  ->  fs  ->  {pwd,root} a las ubicaciones correspondientes en el nuevo espacio de nombres. Ahora procedemos a copy_cgroup_ns(), que falla (p. ej., con -ENOMEM). Llamamos a put_mnt_ns() en el espacio de nombres creado por copy_mnt_ns(), este es destruido y su árbol de montajes se disuelve, pero... current  ->  fs  ->  root y current  ->  fs  ->  pwd quedan ambos apuntando a montajes ahora desvinculados.\n\nEstán anclando esos, por lo que no es un UAF, pero deja al proceso llamador con unshare(2) fallando con -ENOMEM _y_ dejándolo con pwd y root en montajes aislados desvinculados. La última parte es claramente un error.\n\nHay otras cosas divertidas relacionadas con ese lío (condiciones de carrera con pivot_root(), incluyendo la que se da entre pivot_root() y fork(), de todas las cosas), pero esta es fácil de aislar y corregir: tratar CLONE_NEWNS como ’asignar una nueva fs_struct incluso si no se había compartido en primer lugar’. Claro, podríamos optar por algo como ’si tanto CLONE_NEWNS como una de las cosas que podrían terminar fallando después de la llamada a copy_mnt_ns() en create_new_namespaces() están configuradas, forzar la asignación de una nueva fs_struct’, pero mantengámoslo simple: el costo de copy_fs_struct() es trivial.\n\nOtro beneficio es que copy_mnt_ns() con CLONE_NEWNS siempre obtiene una fs_struct recién asignada, aún por adjuntar a algo. Eso simplifica seriamente el análisis...\n\nPara que conste, ese error había estado ahí desde la introducción de unshare(2) ;-/","source":"nvd"}],"published":"2026-05-08T14:22:31.556Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-908"],"affected":[{"ranges":[{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"845bf3c6963a52096d0d3866e4a92db77a0c03d8","status":"affected"},{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"d3ffc8f13034af895531a02c30b1fe3a34b46432","status":"affected"},{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"d0d99f60538ddb4a62ccaac2168d8f448965f083","status":"affected"},{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"d7963d6997fea86a6def242ac36198b86655f912","status":"affected"},{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"aa9ebc084505fb26dd90f4d7a249045aad152043","status":"affected"},{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"af8f4be3b68ac8caa41c8e5ead0eeaf5e85e42d0","status":"affected"},{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"42e21e74061b0ebbd859839f81acf10efad02a27","status":"affected"},{"type":"git","introduced":"741a295130606143edbf9fc740f633dbc1e6225f","fixed":"6c4b2243cb6c0755159bd567130d5e12e7b10d9f","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.16","status":"unaffected"},{"type":"semver","introduced":"5.10.253","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.203","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.167","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.130","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.78","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.19","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.9","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"2.6.16.1","fixed":"5.10.253"},{"status":"affected","introduced":"5.11","fixed":"5.15.203"},{"status":"affected","introduced":"5.16","fixed":"6.1.167"},{"status":"affected","introduced":"6.2","fixed":"6.6.130"},{"status":"affected","introduced":"6.7","fixed":"6.12.78"},{"status":"affected","introduced":"6.13","fixed":"6.18.19"},{"status":"affected","introduced":"6.19","fixed":"6.19.9"},{"status":"affected","version":"2.6.16"},{"status":"affected","version":"2.6.16"},{"status":"affected","version":"2.6.16"},{"status":"affected","version":"2.6.16"},{"status":"affected","version":"2.6.16"},{"status":"affected","version":"2.6.16"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/845bf3c6963a52096d0d3866e4a92db77a0c03d8","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d3ffc8f13034af895531a02c30b1fe3a34b46432","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d0d99f60538ddb4a62ccaac2168d8f448965f083","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d7963d6997fea86a6def242ac36198b86655f912","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/aa9ebc084505fb26dd90f4d7a249045aad152043","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/af8f4be3b68ac8caa41c8e5ead0eeaf5e85e42d0","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/42e21e74061b0ebbd859839f81acf10efad02a27","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6c4b2243cb6c0755159bd567130d5e12e7b10d9f","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-06T15:39:35.857Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43472","url":"https://www.cve.org/CVERecord?id=CVE-2026-43472","licence":"CVE Terms of Use","modified":"2026-11-06T15:42:56.209Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43472","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43472","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"}],"updatedAt":"2026-11-25T22:59:21.088Z","epss":{"score":0.00115,"percentile":0.01671,"date":"2026-12-01T12:00:22.000Z"}}