<?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>Thu, 01 Oct 2026 07:48:48 +0000</lastBuildDate>
    <item>
      <title>CVE-2025-40303 — btrfs: ensure no dirty metadata is written back for an fs with errors</title>
      <link>https://vulnerability.circl.lu/vuln/cve-2025-40303</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: ensure no dirty metadata is written back for an fs with errors&lt;/p&gt;
&lt;p&gt;[BUG]
During development of a minor feature (make sure all btrfs_bio::end_io()
is called in task context), I noticed a crash in generic/388, where
metadata writes triggered new works after btrfs_stop_all_workers().&lt;/p&gt;
&lt;p&gt;It turns out that it can even happen without any code modification, just
using RAID5 for metadata and the same workload from generic/388 is going
to trigger the use-after-free.&lt;/p&gt;
&lt;p&gt;[CAUSE]
If btrfs hits an error, the fs is marked as error, no new
transaction is allowed thus metadata is in a frozen state.&lt;/p&gt;
&lt;p&gt;But there are some metadata modifications before that error, and they are
still in the btree inode page cache.&lt;/p&gt;
&lt;p&gt;Since there will be no real transaction commit, all those dirty folios
are just kept as is in the page cache, and they can not be invalidated
by invalidate_inode_pages2() call inside close_ctree(), because they are
dirty.&lt;/p&gt;
&lt;p&gt;And finally after btrfs_stop_all_workers(), we call iput() on btree
inode, which triggers writeback of those dirty metadata.&lt;/p&gt;
&lt;p&gt;And if the fs is using RAID56 metadata, this will trigger RMW and queue
new works into rmw_workers, which is already stopped, causing warning
from queue_work() and use-after-free.&lt;/p&gt;
&lt;p&gt;[FIX]
Add a special handling for write_one_eb(), that if the fs is already in
an error state, immediately mark the bbio as failure, instead of really
submitting them.&lt;/p&gt;
&lt;p&gt;Then during close_ctree(), ip…&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: ensure no dirty metadata is written back for an fs with errors&lt;/p&gt;
&lt;p&gt;[BUG]
During development of a minor feature (make sure all btrfs_bio::end_io()
is called in task context), I noticed a crash in generic/388, where
metadata writes triggered new works after btrfs_stop_all_workers().&lt;/p&gt;
&lt;p&gt;It turns out that it can even happen without any code modification, just
using RAID5 for metadata and the same workload from generic/388 is going
to trigger the use-after-free.&lt;/p&gt;
&lt;p&gt;[CAUSE]
If btrfs hits an error, the fs is marked as error, no new
transaction is allowed thus metadata is in a frozen state.&lt;/p&gt;
&lt;p&gt;But there are some metadata modifications before that error, and they are
still in the btree inode page cache.&lt;/p&gt;
&lt;p&gt;Since there will be no real transaction commit, all those dirty folios
are just kept as is in the page cache, and they can not be invalidated
by invalidate_inode_pages2() call inside close_ctree(), because they are
dirty.&lt;/p&gt;
&lt;p&gt;And finally after btrfs_stop_all_workers(), we call iput() on btree
inode, which triggers writeback of those dirty metadata.&lt;/p&gt;
&lt;p&gt;And if the fs is using RAID56 metadata, this will trigger RMW and queue
new works into rmw_workers, which is already stopped, causing warning
from queue_work() and use-after-free.&lt;/p&gt;
&lt;p&gt;[FIX]
Add a special handling for write_one_eb(), that if the fs is already in
an error state, immediately mark the bbio as failure, instead of really
submitting them.&lt;/p&gt;
&lt;p&gt;Then during close_ctree(), ip…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/cve-2025-40303</guid>
    </item>
  </channel>
</rss>
