VDB

CVE-2024-40913

CVE-2024-40913 PUBLISHED

cachefiles: defer exposing anon_fd until after copy_to_user() succeeds

Reported by linux · Published July 12, 2024

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

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
linux_kernellinux6.9.6, 6.6.35, 6.1.95

Affected products

VendorProductVersions
LinuxLinuxc8383054506c77b814489c09877b5db83fd4abf2, c8383054506c77b814489c09877b5db83fd4abf2, c8383054506c77b814489c09877b5db83fd4abf2
LinuxLinux5.19, 0, 6.1.95
LinuxLinux*, *, 6.10
amazon:2023kernel-livepatch-6.1.96-102.1770
linuxlinux_kernel5.19, 5.19, 5.19
amazon:2023perf0
amazon:2023kernel-modules-extra0
amazon:2023kernel-headers0
amazon:2023kernel-libbpf-static0
amazon:2023bpftool0
amazon:2023python3-perf0
amazon:2023kernel-modules-extra-common0
amazon:2023kernel-devel0
amazon:2023kernel-tools0
amazon:2023kernel-libbpf0
amazon:2023kernel0
amazon:2023kernel-tools-devel0
amazon:2023kernel-libbpf-devel0

Timeline

  • Jul 12, 2024 CVE Published
  • Jul 13, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (8 in total, the first dated here)
  • Jan 6, 2025 CVE Updated
  • Jan 7, 2026 Security Advisory (271 in total, the first dated here)
  • Mar 30, 2026 Distribution Patch (174 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-40913
vulnetix vdb fixes CVE-2024-40913

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-40913/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›