btrfs: fix incorrect splitting in btrfs_drop_extent_map_range
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
2.6.33
|
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix incorrect splitting in btrfs_drop_extent_map_range
In production we were seeing a variety of WARN_ON()'s in the extent_map code, specifically in btrfs_drop_extent_map_range() when we have to call add_extent_mapping() for our second split.
Consider the following extent map layout
PINNED [0 16K) [32K, 48K)
and then we call btrfs_drop_extent_map_range for [0, 36K), with skip_pinned == true. The initial loop will have
start = 0 end = 36K len = 36K
we will find the [0, 16k) extent, but since we are pinned we will skip it, which has this code
From the CVE record · Linux
A calculation error in the Linux kernel’s btrfs_drop_extent_map_range() can insert an invalid extent map when a pinned extent is skipped during relocation. This can trigger warnings and incorrect block calculations; the input does not describe an attacker path, authentication requirement, or user interaction.
Engineers running Linux systems that use btrfs should check their kernel versions; affected versions are not specified.