<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://vulnerability.circl.lu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Mon, 28 Sep 2026 09:32:33 +0000</lastBuildDate>
    <item>
      <title>CVE-2023-54121 — btrfs: fix incorrect splitting in btrfs_drop_extent_map_range</title>
      <link>https://vulnerability.circl.lu/vuln/cve-2023-54121</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;btrfs: fix incorrect splitting in btrfs_drop_extent_map_range&lt;/p&gt;
&lt;p&gt;In production we were seeing a variety of WARN_ON()&amp;#39;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.&lt;/p&gt;
&lt;p&gt;Consider the following extent map layout&lt;/p&gt;
&lt;p&gt;PINNED
	[0 16K)  [32K, 48K)&lt;/p&gt;
&lt;p&gt;and then we call btrfs_drop_extent_map_range for [0, 36K), with
skip_pinned == true.  The initial loop will have&lt;/p&gt;
&lt;p&gt;start = 0
	end = 36K
	len = 36K&lt;/p&gt;
&lt;p&gt;we will find the [0, 16k) extent, but since we are pinned we will skip
it, which has this code&lt;/p&gt;
&lt;p&gt;start = em_end;
	if (end != (u64)-1)
		len = start + len - em_end;&lt;/p&gt;
&lt;p&gt;em_end here is 16K, so now the values are&lt;/p&gt;
&lt;p&gt;start = 16K
	len = 16K + 36K - 16K = 36K&lt;/p&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;p&gt;split-&amp;gt;start = start + len;
	split-&amp;gt;len = em_end - (start + len);&lt;/p&gt;
&lt;p&gt;In this case we have&lt;/p&gt;
&lt;p&gt;em_end = 48K
	split-&amp;gt;start = 16K + 36K       // this should be 16K + 20K
	split-&amp;gt;len = 48K - (16K + 36K) // this overflows as 16K + 36K is 52K&lt;/p&gt;
&lt;p&gt;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-&amp;gt;start set improperly, which will cause problems
with any block related calculations.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t actually need len in this…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;btrfs: fix incorrect splitting in btrfs_drop_extent_map_range&lt;/p&gt;
&lt;p&gt;In production we were seeing a variety of WARN_ON()&amp;#39;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.&lt;/p&gt;
&lt;p&gt;Consider the following extent map layout&lt;/p&gt;
&lt;p&gt;PINNED
	[0 16K)  [32K, 48K)&lt;/p&gt;
&lt;p&gt;and then we call btrfs_drop_extent_map_range for [0, 36K), with
skip_pinned == true.  The initial loop will have&lt;/p&gt;
&lt;p&gt;start = 0
	end = 36K
	len = 36K&lt;/p&gt;
&lt;p&gt;we will find the [0, 16k) extent, but since we are pinned we will skip
it, which has this code&lt;/p&gt;
&lt;p&gt;start = em_end;
	if (end != (u64)-1)
		len = start + len - em_end;&lt;/p&gt;
&lt;p&gt;em_end here is 16K, so now the values are&lt;/p&gt;
&lt;p&gt;start = 16K
	len = 16K + 36K - 16K = 36K&lt;/p&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;p&gt;split-&amp;gt;start = start + len;
	split-&amp;gt;len = em_end - (start + len);&lt;/p&gt;
&lt;p&gt;In this case we have&lt;/p&gt;
&lt;p&gt;em_end = 48K
	split-&amp;gt;start = 16K + 36K       // this should be 16K + 20K
	split-&amp;gt;len = 48K - (16K + 36K) // this overflows as 16K + 36K is 52K&lt;/p&gt;
&lt;p&gt;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-&amp;gt;start set improperly, which will cause problems
with any block related calculations.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t actually need len in this…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/cve-2023-54121</guid>
    </item>
  </channel>
</rss>
