{"id":"CVE-2024-40913","aliases":["CVE-2024-40913"],"related":[],"kind":"vulnerability","state":"published","title":"cachefiles: defer exposing anon_fd until after copy_to_user() succeeds","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncachefiles: defer exposing anon_fd until after copy_to_user() succeeds\n\nAfter installing the anonymous fd, we can now see it in userland and close\nit. However, at this point we may not have gotten the reference count of\nthe cache, but we will put it during colse fd, so this may cause a cache\nUAF.\n\nSo grab the cache reference count before fd_install(). In addition, by\nkernel convention, fd is taken over by the user land after fd_install(),\nand the kernel should not call close_fd() after that, i.e., it should call\nfd_install() after everything is ready, thus fd_install() is called after\ncopy_to_user() succeeds.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncachefiles: defer exposing anon_fd until after copy_to_user() succeeds\n\nAfter installing the anonymous fd, we can now see it in userland and close\nit. However, at this point we may not have gotten the reference count of\nthe cache, but we will put it during colse fd, so this may cause a cache\nUAF.\n\nSo grab the cache reference count before fd_install(). In addition, by\nkernel convention, fd is taken over by the user land after fd_install(),\nand the kernel should not call close_fd() after that, i.e., it should call\nfd_install() after everything is ready, thus fd_install() is called after\ncopy_to_user() succeeds.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: cachefiles: difiere la exposición de anon_fd hasta que copy_to_user() tenga éxito. Después de instalar el fd anónimo, ahora podemos verlo en el área de usuario y cerrarlo. Sin embargo, en este punto es posible que no hayamos obtenido el recuento de referencias del caché, pero lo colocaremos durante colse fd, por lo que esto puede causar un UAF de caché. Así que tome el recuento de referencias de caché antes de fd_install(). Además, según la convención del kernel, el usuario se hace cargo de fd después de fd_install(), y el kernel no debe llamar a close_fd() después de eso, es decir, debe llamar a fd_install() después de que todo esté listo, por lo que fd_install() es llamado después de que copy_to_user() tenga éxito.","source":"nvd"}],"published":"2024-07-12T12:24:57.363Z","modified":"2026-06-17T07:46:51.360Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"c8383054506c77b814489c09877b5db83fd4abf2","fixed":"eac51d9daacd61dcc93333ff6a890cf3efc8c1c0","status":"affected"},{"type":"git","introduced":"c8383054506c77b814489c09877b5db83fd4abf2","fixed":"d2d3eb377a5d081bf2bed177d354a4f59b74da88","status":"affected"},{"type":"git","introduced":"c8383054506c77b814489c09877b5db83fd4abf2","fixed":"b9f58cdae6a364a3270fd6b6a46e0fd4f7f8ce32","status":"affected"},{"type":"git","introduced":"c8383054506c77b814489c09877b5db83fd4abf2","fixed":"4b4391e77a6bf24cba2ef1590e113d9b73b11039","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.19","status":"unaffected"},{"type":"semver","introduced":"6.1.95","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.35","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.9.6","lastAffected":"6.9.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.10","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":"5.19","fixed":"6.1.95"},{"status":"affected","introduced":"6.2","fixed":"6.6.35"},{"status":"affected","introduced":"6.7","fixed":"6.9.6"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/eac51d9daacd61dcc93333ff6a890cf3efc8c1c0","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d2d3eb377a5d081bf2bed177d354a4f59b74da88","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b9f58cdae6a364a3270fd6b6a46e0fd4f7f8ce32","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4b4391e77a6bf24cba2ef1590e113d9b73b11039","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-10T17:05:56.112Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-40913","url":"https://www.cve.org/CVERecord?id=CVE-2024-40913","licence":"CVE Terms of Use","modified":"2026-05-11T20:22:15.067Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-40913","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40913","licence":"Public domain","modified":"2026-06-17T07:46:51.360Z"}],"updatedAt":"2026-11-25T22:58:42.835Z","epss":{"score":0.00287,"percentile":0.22859,"date":"2026-12-01T12:00:22.000Z"}}