CVE-2024-40913

Severity CVSS v4.0:
Pending analysis
Type:
CWE-416 Use After Free
Publication date:
12/07/2024
Last modified:
03/11/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> cachefiles: defer exposing anon_fd until after copy_to_user() succeeds<br /> <br /> After installing the anonymous fd, we can now see it in userland and close<br /> it. However, at this point we may not have gotten the reference count of<br /> the cache, but we will put it during colse fd, so this may cause a cache<br /> UAF.<br /> <br /> So grab the cache reference count before fd_install(). In addition, by<br /> kernel convention, fd is taken over by the user land after fd_install(),<br /> and the kernel should not call close_fd() after that, i.e., it should call<br /> fd_install() after everything is ready, thus fd_install() is called after<br /> copy_to_user() succeeds.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.19 (including) 6.1.95 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.2 (including) 6.6.35 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.9.6 (excluding)
cpe:2.3:o:linux:linux_kernel:6.10:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.10:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.10:rc3:*:*:*:*:*:*