{"id":"CVE-2025-40212","aliases":["CVE-2025-40212"],"related":[],"kind":"vulnerability","state":"published","title":"nfsd: fix refcount leak in nfsd_set_fh_dentry()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnfsd: fix refcount leak in nfsd_set_fh_dentry()\n\nnfsd exports a \"pseudo root filesystem\" which is used by NFSv4 to find\nthe various exported filesystems using LOOKUP requests from a known root\nfilehandle.  NFSv3 uses the MOUNT protocol to find those exported\nfilesystems and so is not given access to the pseudo root filesystem.\n\nIf a v3 (or v2) client uses a filehandle from that filesystem,\nnfsd_set_fh_dentry() will report an error, but still stores the export\nin \"struct svc_fh\" even though it also drops the reference (exp_put()).\nThis means that when fh_put() is called an extra reference will be dropped\nwhich can lead to use-after-free and possible denial of service.\n\nNormal NFS usage will not provide a pseudo-root filehandle to a v3\nclient.  This bug can only be triggered by the client synthesising an\nincorrect filehandle.\n\nTo fix this we move the assignments to the svc_fh later, after all\npossible error cases have been detected.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnfsd: fix refcount leak in nfsd_set_fh_dentry()\n\nnfsd exports a \"pseudo root filesystem\" which is used by NFSv4 to find\nthe various exported filesystems using LOOKUP requests from a known root\nfilehandle.  NFSv3 uses the MOUNT protocol to find those exported\nfilesystems and so is not given access to the pseudo root filesystem.\n\nIf a v3 (or v2) client uses a filehandle from that filesystem,\nnfsd_set_fh_dentry() will report an error, but still stores the export\nin \"struct svc_fh\" even though it also drops the reference (exp_put()).\nThis means that when fh_put() is called an extra reference will be dropped\nwhich can lead to use-after-free and possible denial of service.\n\nNormal NFS usage will not provide a pseudo-root filehandle to a v3\nclient.  This bug can only be triggered by the client synthesising an\nincorrect filehandle.\n\nTo fix this we move the assignments to the svc_fh later, after all\npossible error cases have been detected.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nnfsd: corregir fuga de contador de referencias en nfsd_set_fh_dentry()\n\nnfsd exporta un 'pseudo sistema de archivos raíz' que es utilizado por NFSv4 para encontrar los diversos sistemas de archivos exportados usando solicitudes LOOKUP desde un filehandle raíz conocido. NFSv3 utiliza el protocolo MOUNT para encontrar esos sistemas de archivos exportados y por lo tanto no se le da acceso al pseudo sistema de archivos raíz.\n\nSi un cliente v3 (o v2) utiliza un filehandle de ese sistema de archivos, nfsd_set_fh_dentry() reportará un error, pero aún almacena la exportación en 'struct svc_fh' a pesar de que también libera la referencia (exp_put()). Esto significa que cuando se llama a fh_put(), se liberará una referencia adicional, lo que puede llevar a uso después de liberación y posible denegación de servicio.\n\nEl uso normal de NFS no proporcionará un filehandle pseudo-raíz a un cliente v3. Este error solo puede ser desencadenado por el cliente sintetizando un filehandle incorrecto.\n\nPara corregir esto, movemos las asignaciones al svc_fh más tarde, después de que se hayan detectado todos los posibles casos de error.","source":"nvd"}],"published":"2025-11-24T13:04:20.888Z","modified":"2026-10-18T20:10:00.110Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"ef7f6c4904d03ccd7478e1ac20ed75f79c4ac444","fixed":"b6bc86ce3944b10b9fc181fc00c1a520a20ed965","status":"affected"},{"type":"git","introduced":"ef7f6c4904d03ccd7478e1ac20ed75f79c4ac444","fixed":"c83d7365cec5eb5ebeeee2a72e29b4ca58a7e4c2","status":"affected"},{"type":"git","introduced":"ef7f6c4904d03ccd7478e1ac20ed75f79c4ac444","fixed":"8a7348a9ed70bda1c1f51d3f1815bcbdf9f3b38c","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.12","status":"unaffected"},{"type":"semver","introduced":"6.12.59","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.17.9","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/b6bc86ce3944b10b9fc181fc00c1a520a20ed965","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c83d7365cec5eb5ebeeee2a72e29b4ca58a7e4c2","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8a7348a9ed70bda1c1f51d3f1815bcbdf9f3b38c","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40212","url":"https://www.cve.org/CVERecord?id=CVE-2025-40212","licence":"CVE Terms of Use","modified":"2026-08-05T12:08:37.417Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40212","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40212","licence":"Public domain","modified":"2026-10-18T20:10:00.110Z"}],"updatedAt":"2026-11-25T22:59:07.958Z","epss":{"score":0.0043,"percentile":0.39116,"date":"2026-12-01T12:00:22.000Z"}}