CVE-2024-40913
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.
| Package | Ecosystem | Fixed in |
|---|---|---|
| linux_kernel | linux | 6.9.6, 6.6.35, 6.1.95 |
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | c8383054506c77b814489c09877b5db83fd4abf2, c8383054506c77b814489c09877b5db83fd4abf2, c8383054506c77b814489c09877b5db83fd4abf2 |
| Linux | Linux | 5.19, 0, 6.1.95 |
| Linux | Linux | *, *, 6.10 |
| amazon:2023 | kernel-livepatch-6.1.96-102.177 | 0 |
| linux | linux_kernel | 5.19, 5.19, 5.19 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
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