CVE-2022-50293

btrfs: do not BUG_ON() on ENOMEM when dropping extent items for a range

MEDIUM
5.5
CVSS Score
Published: September 15, 2025 at 02:45 PM UTC
Updated: June 17, 2026 at 05:23 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%

Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: do not BUG_ON() on ENOMEM when dropping extent items for a range If we get -ENOMEM while dropping file extent items in a given range, at btrfs_drop_extents(), due to failure to allocate memory when attempting to increment the reference count for an extent or drop the reference count, we handle it with a BUG_ON(). This is excessive, instead we can simply abort the transaction and return the error to the caller. In fact most callers of btrfs_drop_extents(), directly or indirectly, already abort the transaction if btrfs_drop_extents() returns any error. Also, we already have error paths at btrfs_drop_extents() that may return -ENOMEM and in those cases we abort the transaction, like for example anything that changes the b+tree may return -ENOMEM due to a failure to allocate a new extent buffer when COWing an existing extent buffer, such as a call to btrfs_duplicate_item() for example. So replace the BUG_ON() calls with proper logic to abort the transaction and return the error.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 5.15.862.6.29 ≤ v < 5.15.862.6.29 ≤ v < 6.0.162.6.29 ≤ v < 6.1.22.6.29 ≤ v < 6.25.16 ≤ v < 6.0.166.1 ≤ v < 6.1.22.6.2939279cc3d2704cfbf9c35dcb5bdd392159ae4625
Vendor states this is fixed in 162d053e15fe985f754ef495a96eb3db970c43ed (fixed)
Vendor states this is fixed in 1baf3370e2dc5e6bd1368348736189457dab2a27 (fixed)
Vendor states this is fixed in 50f993da945074b2a069da099a0331b23a0c89a0 (fixed)
Vendor states this is fixed in 7fbcb635c8fc927d139f3302babcf1b42c09265c (fixed)
Vendor states this is fixed in 2.6.29 (unaffected)
Vendor states this is fixed in 5.15.86 (unaffected)
Vendor states this is fixed in 6.0.16 (unaffected)
Vendor states this is fixed in 6.1.2 (unaffected)
Vendor states this is fixed in 6.2 (unaffected)

References (4)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/162d053e15fe985f754ef495a96eb3db970c43ed
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/1baf3370e2dc5e6bd1368348736189457dab2a27
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/50f993da945074b2a069da099a0331b23a0c89a0
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7fbcb635c8fc927d139f3302babcf1b42c09265c

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-617

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card