<?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://cve.radiocsirt.org</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 00:20:39 +0000</lastBuildDate>
    <item>
      <title>CVE-2022-50067 — btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()</title>
      <link>https://cve.radiocsirt.org/vuln/cve-2022-50067</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: unset reloc control if transaction commit fails in prepare_to_relocate()&lt;/p&gt;
&lt;p&gt;In btrfs_relocate_block_group(), the rc is allocated.  Then
btrfs_relocate_block_group() calls&lt;/p&gt;
&lt;p&gt;relocate_block_group()
  prepare_to_relocate()
    set_reloc_control()&lt;/p&gt;
&lt;p&gt;that assigns rc to the variable fs_info-&amp;gt;reloc_ctl. When
prepare_to_relocate() returns, it calls&lt;/p&gt;
&lt;p&gt;btrfs_commit_transaction()
  btrfs_start_dirty_block_groups()
    btrfs_alloc_path()
      kmem_cache_zalloc()&lt;/p&gt;
&lt;p&gt;which may fail for example (or other errors could happen). When the
failure occurs, btrfs_relocate_block_group() detects the error and frees
rc and doesn&amp;#39;t set fs_info-&amp;gt;reloc_ctl to NULL. After that, in
btrfs_init_reloc_root(), rc is retrieved from fs_info-&amp;gt;reloc_ctl and
then used, which may cause a use-after-free bug.&lt;/p&gt;
&lt;p&gt;This possible bug can be triggered by calling btrfs_ioctl_balance()
before calling btrfs_ioctl_defrag().&lt;/p&gt;
&lt;p&gt;To fix this possible bug, in prepare_to_relocate(), check if
btrfs_commit_transaction() fails. If the failure occurs,
unset_reloc_control() is called to set fs_info-&amp;gt;reloc_ctl to NULL.&lt;/p&gt;
&lt;p&gt;The error log in our fault-injection testing is shown as follows:&lt;/p&gt;
&lt;p&gt;[   58.751070] BUG: KASAN: use-after-free in btrfs_init_reloc_root+0x7ca/0x920 [btrfs]
  ...
  [   58.753577] Call Trace:
  ...
  [   58.755800]  kasan_report+0x45/0x60
  [   58.756066]  btrfs_init_reloc_root+0x7ca/0x920 [btrfs]
  [   58.757304]  record_root_in_trans+0x792/0xa10 [btrfs]…&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: unset reloc control if transaction commit fails in prepare_to_relocate()&lt;/p&gt;
&lt;p&gt;In btrfs_relocate_block_group(), the rc is allocated.  Then
btrfs_relocate_block_group() calls&lt;/p&gt;
&lt;p&gt;relocate_block_group()
  prepare_to_relocate()
    set_reloc_control()&lt;/p&gt;
&lt;p&gt;that assigns rc to the variable fs_info-&amp;gt;reloc_ctl. When
prepare_to_relocate() returns, it calls&lt;/p&gt;
&lt;p&gt;btrfs_commit_transaction()
  btrfs_start_dirty_block_groups()
    btrfs_alloc_path()
      kmem_cache_zalloc()&lt;/p&gt;
&lt;p&gt;which may fail for example (or other errors could happen). When the
failure occurs, btrfs_relocate_block_group() detects the error and frees
rc and doesn&amp;#39;t set fs_info-&amp;gt;reloc_ctl to NULL. After that, in
btrfs_init_reloc_root(), rc is retrieved from fs_info-&amp;gt;reloc_ctl and
then used, which may cause a use-after-free bug.&lt;/p&gt;
&lt;p&gt;This possible bug can be triggered by calling btrfs_ioctl_balance()
before calling btrfs_ioctl_defrag().&lt;/p&gt;
&lt;p&gt;To fix this possible bug, in prepare_to_relocate(), check if
btrfs_commit_transaction() fails. If the failure occurs,
unset_reloc_control() is called to set fs_info-&amp;gt;reloc_ctl to NULL.&lt;/p&gt;
&lt;p&gt;The error log in our fault-injection testing is shown as follows:&lt;/p&gt;
&lt;p&gt;[   58.751070] BUG: KASAN: use-after-free in btrfs_init_reloc_root+0x7ca/0x920 [btrfs]
  ...
  [   58.753577] Call Trace:
  ...
  [   58.755800]  kasan_report+0x45/0x60
  [   58.756066]  btrfs_init_reloc_root+0x7ca/0x920 [btrfs]
  [   58.757304]  record_root_in_trans+0x792/0xa10 [btrfs]…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://cve.radiocsirt.org/vuln/cve-2022-50067</guid>
    </item>
  </channel>
</rss>
