VDB

CVE-2024-39496

CVE-2024-39496 PUBLISHED CVSS 7.8 HIGH

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.

PackageEcosystemFixed in
kernel-develAmazon Linux6.1.96-102.177.amzn2023
kernel-libbpf-staticAmazon Linux6.1.96-102.177.amzn2023
linux_kernellinux6.9.6, 6.6.35, 6.1.95

Risk scores

CVSS 3.1
7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected products

VendorProductVersions
LinuxLinux5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141
LinuxLinux5.11, 0, 6.1.95
amazon:2023kernel-devel0
amazon:2023kernel-libbpf-static0
linuxlinux_kernel5.11, 5.11, 5.11
amazon:2023kernel-headers0
amazon:2023kernel-tools-devel0
amazon:2023kernel-modules-extra0
LinuxLinux5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141, 5b316468983dfa9473ff0f1c42e4e30b4c267141
amazon:2023kernel0
amazon:2023python3-perf0
amazon:2023kernel-livepatch-6.1.96-102.1770
amazon:2023kernel-libbpf-devel0
amazon:2023kernel-tools0
amazon:2023bpftool0
amazon:2023perf0
amazon:2023kernel-libbpf0
amazon:2023kernel-modules-extra-common0

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

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