CVE-2022-50300 btrfs: fix extent map use-after-free when handling missing device in read_one_chunk
A use-after-free in the Linux kernel Btrfs filesystem allows local attackers to potentially execute code or escalate privileges when handling missing devices.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-50300?
CVE-2022-50300 is a high-severity use after free vulnerability in Linux kernel, published on 15 Sep 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official 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
Weakness: CWE-416
Which versions are affected by CVE-2022-50300?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-50300?
Apply the vendor's patch.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2022-50300 being exploited?
There is no known exploitation of CVE-2022-50300 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-50300, GHSA-w775-9978-cp8r, ROOT-OS-DEBIAN-11-CVE-2022-50300, UBUNTU-CVE-2022-50300.