# CVE-2022-50300: btrfs: fix extent map use-after-free when handling missing device in read_one_chunk

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/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.17%, higher than 7% of CVEs (2026-12-01)
- Published: 2025-09-15T14:45:55.896Z
- Modified: 2026-08-05T08:58:04.535Z
- Weaknesses: CWE-416
- Assigned by: Linux

## Description

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

btrfs: fix extent map use-after-free when handling missing device in read_one_chunk

Store the error code before freeing the extent_map. Though it's
reference counted structure, in that function it's the first and last
allocation so this would lead to a potential use-after-free.

The error can happen eg. when chunk is stored on a missing device and
the degraded mount option is missing.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216721

(As written by CVE List.)

## Affected

- Linux Linux: from adfb69af7d8cb6a3958f75aad1ef4bc96891d116 before b8e7ed42bc3ca0d0e4191ee394d34962d3624c22; from adfb69af7d8cb6a3958f75aad1ef4bc96891d116 before fce3713197ebba239e1c7e02174ed216ea1ee014; from adfb69af7d8cb6a3958f75aad1ef4bc96891d116 before 169a4cf46882974d4db6d85eb623ec898e51bbc0; from adfb69af7d8cb6a3958f75aad1ef4bc96891d116 before 1742e1c90c3da344f3bb9b1f1309b3f47482756a; 4.15 (not affected: before 4.15; from 5.15.87 up to 5.15.*; from 6.0.18 up to 6.0.*; from 6.1.4 up to 6.1.*; from 6.2 up to *)
- linux linux_kernel: from 4.15 before 5.15.87; from 5.16 before 6.0.18; from 6.1 before 6.1.4

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/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/b8e7ed42bc3ca0d0e4191ee394d34962d3624c22> (patch)
- <https://git.kernel.org/stable/c/fce3713197ebba239e1c7e02174ed216ea1ee014> (patch)
- <https://git.kernel.org/stable/c/169a4cf46882974d4db6d85eb623ec898e51bbc0> (patch)
- <https://git.kernel.org/stable/c/1742e1c90c3da344f3bb9b1f1309b3f47482756a> (patch)

## Sources

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

---

Page: https://cve.day/CVE-2022-50300 · Whole record: https://cve.day/CVE-2022-50300.json · Rebuilt by cve.day 2026-11-25T22:58:21.154Z
