<?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>Tue, 06 Oct 2026 12:40:49 +0000</lastBuildDate>
    <item>
      <title>CVE-2022-49075 — btrfs: fix qgroup reserve overflow the qgroup limit</title>
      <link>https://vulnerability.circl.lu/vuln/cve-2022-49075</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 qgroup reserve overflow the qgroup limit&lt;/p&gt;
&lt;p&gt;We use extent_changeset-&amp;gt;bytes_changed in qgroup_reserve_data() to record
how many bytes we set for EXTENT_QGROUP_RESERVED state. Currently the
bytes_changed is set as &amp;#34;unsigned int&amp;#34;, and it will overflow if we try to
fallocate a range larger than 4GiB. The result is we reserve less bytes
and eventually break the qgroup limit.&lt;/p&gt;
&lt;p&gt;Unlike regular buffered/direct write, which we use one changeset for
each ordered extent, which can never be larger than 256M.  For
fallocate, we use one changeset for the whole range, thus it no longer
respects the 256M per extent limit, and caused the problem.&lt;/p&gt;
&lt;p&gt;The following example test script reproduces the problem:&lt;/p&gt;
&lt;p&gt;$ cat qgroup-overflow.sh
  #!/bin/bash&lt;/p&gt;
&lt;p&gt;DEV=/dev/sdj
  MNT=/mnt/sdj&lt;/p&gt;
&lt;p&gt;mkfs.btrfs -f $DEV
  mount $DEV $MNT&lt;/p&gt;
&lt;p&gt;# Set qgroup limit to 2GiB.
  btrfs quota enable $MNT
  btrfs qgroup limit 2G $MNT&lt;/p&gt;
&lt;p&gt;# Try to fallocate a 3GiB file. This should fail.
  echo
  echo &amp;#34;Try to fallocate a 3GiB file...&amp;#34;
  fallocate -l 3G $MNT/3G.file&lt;/p&gt;
&lt;p&gt;# Try to fallocate a 5GiB file.
  echo
  echo &amp;#34;Try to fallocate a 5GiB file...&amp;#34;
  fallocate -l 5G $MNT/5G.file&lt;/p&gt;
&lt;p&gt;# See we break the qgroup limit.
  echo
  sync
  btrfs qgroup show -r $MNT&lt;/p&gt;
&lt;p&gt;umount $MNT&lt;/p&gt;
&lt;p&gt;When running the test:&lt;/p&gt;
&lt;p&gt;$ ./qgroup-overflow.sh
  (...)&lt;/p&gt;
&lt;p&gt;Try to fallocate a 3GiB file...
  fallocate: fallocate failed: Disk quota exceeded&lt;/p&gt;
&lt;p&gt;Try to fallocate a 5GiB file...&lt;/p&gt;
&lt;p&gt;qgrou…&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 qgroup reserve overflow the qgroup limit&lt;/p&gt;
&lt;p&gt;We use extent_changeset-&amp;gt;bytes_changed in qgroup_reserve_data() to record
how many bytes we set for EXTENT_QGROUP_RESERVED state. Currently the
bytes_changed is set as &amp;#34;unsigned int&amp;#34;, and it will overflow if we try to
fallocate a range larger than 4GiB. The result is we reserve less bytes
and eventually break the qgroup limit.&lt;/p&gt;
&lt;p&gt;Unlike regular buffered/direct write, which we use one changeset for
each ordered extent, which can never be larger than 256M.  For
fallocate, we use one changeset for the whole range, thus it no longer
respects the 256M per extent limit, and caused the problem.&lt;/p&gt;
&lt;p&gt;The following example test script reproduces the problem:&lt;/p&gt;
&lt;p&gt;$ cat qgroup-overflow.sh
  #!/bin/bash&lt;/p&gt;
&lt;p&gt;DEV=/dev/sdj
  MNT=/mnt/sdj&lt;/p&gt;
&lt;p&gt;mkfs.btrfs -f $DEV
  mount $DEV $MNT&lt;/p&gt;
&lt;p&gt;# Set qgroup limit to 2GiB.
  btrfs quota enable $MNT
  btrfs qgroup limit 2G $MNT&lt;/p&gt;
&lt;p&gt;# Try to fallocate a 3GiB file. This should fail.
  echo
  echo &amp;#34;Try to fallocate a 3GiB file...&amp;#34;
  fallocate -l 3G $MNT/3G.file&lt;/p&gt;
&lt;p&gt;# Try to fallocate a 5GiB file.
  echo
  echo &amp;#34;Try to fallocate a 5GiB file...&amp;#34;
  fallocate -l 5G $MNT/5G.file&lt;/p&gt;
&lt;p&gt;# See we break the qgroup limit.
  echo
  sync
  btrfs qgroup show -r $MNT&lt;/p&gt;
&lt;p&gt;umount $MNT&lt;/p&gt;
&lt;p&gt;When running the test:&lt;/p&gt;
&lt;p&gt;$ ./qgroup-overflow.sh
  (...)&lt;/p&gt;
&lt;p&gt;Try to fallocate a 3GiB file...
  fallocate: fallocate failed: Disk quota exceeded&lt;/p&gt;
&lt;p&gt;Try to fallocate a 5GiB file...&lt;/p&gt;
&lt;p&gt;qgrou…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/cve-2022-49075</guid>
    </item>
  </channel>
</rss>
