CVE-2023-54121
Last modified
CVE-2023-54121 is a high-severity vulnerability rated 7.8/10 on the CVSS scale. 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 start = em_end; if (end != (u64)-1) len = start + len - em_end; em_end here is 16K, so now the values are start = 16K len = 16K + 36K - 16K = 36K len should instead be 20K. EPSS estimates a 0.18% chance of exploitation in the next 30 days.
Description
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 start = em_end; if (end != (u64)-1) len = start + len - em_end; em_end here is 16K, so now the values are start = 16K len = 16K + 36K - 16K = 36K len should instead be 20K. This is a problem when we find the next extent at [32K, 48K), we need to split this extent to leave [36K, 48k), however the code for the split looks like this split->start = start + len; split->len = em_end - (start + len); In this case we have em_end = 48K split->start = 16K + 36K // this should be 16K + 20K split->len = 48K - (16K + 36K) // this overflows as 16K + 36K is 52K and now we have an invalid extent_map in the tree that potentially overlaps other entries in the extent map. Even in the non-overlapping case we will have split->start set improperly, which will cause problems with any block related calculations. We don't actually need len in this loop, we can simply use end as our end point, and only adjust start up when we find a pinned extent we need to skip. Adjust the logic to do this, which keeps us from inserting an invalid extent map. We only skip_pinned in the relocation case, so this is relatively rare, except in the case where you are running relocation a lot, which can happen with auto relocation on.
Metrics
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected Software
Source: CNA advisory (CVE.org). NVD analysis pending.
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | >= 55ef68990029fcd8d04d42fc184aa7fb18cf309e, < 9f68e2105dd96cf0fafffffafb2337fbd0fbae1f; >= 55ef68990029fcd8d04d42fc184aa7fb18cf309e, < b43a4c99d878cf5e59040e45c96bb0a8358bfb3b; >= 55ef68990029fcd8d04d42fc184aa7fb18cf309e, < c962098ca4af146f2625ed64399926a098752c9c; c87afd35a28b2661a2626a1b28e9fd69adcad9f9; >= 2.6.32.19, < 2.6.33 |
| Linux | Linux | 2.6.33 |
References
Timeline
- Published
- Last Modified
- Status
- Deferred
Frequently Asked Questions
What is CVE-2023-54121?
How severe is CVE-2023-54121?
How do I fix CVE-2023-54121?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2023
- CVE-2023-54116In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2023-54117In the Linux kernel, the following vulnerability has been re…
- CVE-2023-54118In the Linux kernel, the following vulnerability has been re…
- CVE-2023-54119In the Linux kernel, the following vulnerability has been re…
- CVE-2023-5412The Image horizontal reel scroll slideshow plugin for WordPr…6.5
- CVE-2023-54120In the Linux kernel, the following vulnerability has been re…8.8
- CVE-2023-54122In the Linux kernel, the following vulnerability has been re…
- CVE-2023-54123In the Linux kernel, the following vulnerability has been re…
- CVE-2023-54124In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2023-54125In the Linux kernel, the following vulnerability has been re…7.8
- CVE-2023-54126In the Linux kernel, the following vulnerability has been re…
- CVE-2023-54127In the Linux kernel, the following vulnerability has been re…7.8
Are you affected by CVE-2023-54121?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
