# CVE-2024-42314: btrfs: fix extent map use-after-free when adding pages to compressed bio

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 14% of CVEs (2026-12-01)
- Published: 2024-08-17T09:09:23.047Z
- Modified: 2026-08-05T11:36:36.342Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: fix extent map use-after-free when adding pages to compressed bio

At add_ra_bio_pages() we are accessing the extent map to calculate
'add_size' after we dropped our reference on the extent map, resulting
in a use-after-free. Fix this by computing 'add_size' before dropping our
extent map reference.

(As written by CVE List.)

## Affected

- Linux Linux: from 6a4049102055250256623ab1875fabd89004bff8 before c1cc3326e27b0bd7a2806b40bc48e49afaf951e7; from 6a4049102055250256623ab1875fabd89004bff8 before c205565e0f2f439f278a4a94ee97b67ef7b56ae8; from 6a4049102055250256623ab1875fabd89004bff8 before b7859ff398b6b656e1689daa860eb34837b4bb89; from 6a4049102055250256623ab1875fabd89004bff8 before 8e7860543a94784d744c7ce34b78a2e11beefa5c; 5.16 (not affected: before 5.16; from 6.1.108 up to 6.1.*; from 6.6.44 up to 6.6.*; from 6.10.3 up to 6.10.*; from 6.11 up to *)
- debian debian_linux: 11.0
- linux linux_kernel: from 5.16 before 6.1.108; from 6.2 before 6.6.44; from 6.7 before 6.10.3

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/c1cc3326e27b0bd7a2806b40bc48e49afaf951e7> (patch)
- <https://git.kernel.org/stable/c/c205565e0f2f439f278a4a94ee97b67ef7b56ae8> (patch)
- <https://git.kernel.org/stable/c/b7859ff398b6b656e1689daa860eb34837b4bb89> (patch)
- <https://git.kernel.org/stable/c/8e7860543a94784d744c7ce34b78a2e11beefa5c> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2024-42314](https://www.cve.org/CVERecord?id=CVE-2024-42314), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2024-42314](https://nvd.nist.gov/vuln/detail/CVE-2024-42314), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2024-42314 · Whole record: https://cve.day/CVE-2024-42314.json · Rebuilt by cve.day 2026-11-25T22:58:44.481Z
