CVE-2024-39496
btrfs: zoned: fix use-after-free due to race with dev replace
Reported by linux · Published July 12, 2024
In the Linux kernel, the following vulnerability has been resolved: btrfs: zoned: fix use-after-free due to race with dev replace While loading a zone's info during creation of a block group, we can race with a device replace operation and then trigger a use-after-free on the device that was just replaced (source device of the replace operation). This happens because at btrfs_load_zone_info() we extract a device from the chunk map into a local variable and then use the device while not under the protection of the device replace rwsem. So if there's a device replace operation happening when we extract the device and that device is the source of the replace operation, we will trigger a use-after-free if before we finish using the device the replace operation finishes and frees the device. Fix this by enlarging the critical section under the protection of the device replace rwsem so that all uses of the device are done inside the critical section.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel-devel | Amazon Linux | 6.1.96-102.177.amzn2023 |
| kernel-libbpf-static | Amazon Linux | 6.1.96-102.177.amzn2023 |
| linux_kernel | linux | 6.9.6, 6.6.35, 6.1.95 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141 |
| Linux | Linux | 5.11, 0, 6.1.95 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| linux | linux_kernel | 5.11, 5.11, 5.11 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| Linux | Linux | 5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-livepatch-6.1.96-102.177 | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel-modules-extra-common | 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 (20 in total, the first dated here)
- Jan 8, 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-39496
vulnetix vdb fixes CVE-2024-39496
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-39496/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart