<?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, 29 Sep 2026 19:16:01 +0000</lastBuildDate>
    <item>
      <title>CVE-2024-50217 — btrfs: fix use-after-free of block device file in __btrfs_free_extra_devids()</title>
      <link>https://vulnerability.circl.lu/vuln/cve-2024-50217</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 use-after-free of block device file in __btrfs_free_extra_devids()&lt;/p&gt;
&lt;p&gt;Mounting btrfs from two images (which have the same one fsid and two
different dev_uuids) in certain executing order may trigger an UAF for
variable &amp;#39;device-&amp;gt;bdev_file&amp;#39; in __btrfs_free_extra_devids(). And
following are the details:&lt;/p&gt;
&lt;p&gt;1. Attach image_1 to loop0, attach image_2 to loop1, and scan btrfs
   devices by ioctl(BTRFS_IOC_SCAN_DEV):&lt;/p&gt;
&lt;p&gt;/  btrfs_device_1 → loop0
   fs_device
             \  btrfs_device_2 → loop1
2. mount /dev/loop0 /mnt
   btrfs_open_devices
    btrfs_device_1-&amp;gt;bdev_file = btrfs_get_bdev_and_sb(loop0)
    btrfs_device_2-&amp;gt;bdev_file = btrfs_get_bdev_and_sb(loop1)
   btrfs_fill_super
    open_ctree
     fail: btrfs_close_devices // -ENOMEM
	    btrfs_close_bdev(btrfs_device_1)
             fput(btrfs_device_1-&amp;gt;bdev_file)
	      // btrfs_device_1-&amp;gt;bdev_file is freed
	    btrfs_close_bdev(btrfs_device_2)
             fput(btrfs_device_2-&amp;gt;bdev_file)&lt;/p&gt;
&lt;p&gt;3. mount /dev/loop1 /mnt
   btrfs_open_devices
    btrfs_get_bdev_and_sb(&amp;amp;bdev_file)
     // EIO, btrfs_device_1-&amp;gt;bdev_file is not assigned,
     // which points to a freed memory area
    btrfs_device_2-&amp;gt;bdev_file = btrfs_get_bdev_and_sb(loop1)
   btrfs_fill_super
    open_ctree
     btrfs_free_extra_devids
      if (btrfs_device_1-&amp;gt;bdev_file)
       fput(btrfs_device_1-&amp;gt;bdev_file) // UAF !&lt;/p&gt;
&lt;p&gt;Fix it by setting &amp;#39;device-&amp;gt;bdev_file&amp;#39; as &amp;#39;NULL&amp;#39; after closing t…&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 use-after-free of block device file in __btrfs_free_extra_devids()&lt;/p&gt;
&lt;p&gt;Mounting btrfs from two images (which have the same one fsid and two
different dev_uuids) in certain executing order may trigger an UAF for
variable &amp;#39;device-&amp;gt;bdev_file&amp;#39; in __btrfs_free_extra_devids(). And
following are the details:&lt;/p&gt;
&lt;p&gt;1. Attach image_1 to loop0, attach image_2 to loop1, and scan btrfs
   devices by ioctl(BTRFS_IOC_SCAN_DEV):&lt;/p&gt;
&lt;p&gt;/  btrfs_device_1 → loop0
   fs_device
             \  btrfs_device_2 → loop1
2. mount /dev/loop0 /mnt
   btrfs_open_devices
    btrfs_device_1-&amp;gt;bdev_file = btrfs_get_bdev_and_sb(loop0)
    btrfs_device_2-&amp;gt;bdev_file = btrfs_get_bdev_and_sb(loop1)
   btrfs_fill_super
    open_ctree
     fail: btrfs_close_devices // -ENOMEM
	    btrfs_close_bdev(btrfs_device_1)
             fput(btrfs_device_1-&amp;gt;bdev_file)
	      // btrfs_device_1-&amp;gt;bdev_file is freed
	    btrfs_close_bdev(btrfs_device_2)
             fput(btrfs_device_2-&amp;gt;bdev_file)&lt;/p&gt;
&lt;p&gt;3. mount /dev/loop1 /mnt
   btrfs_open_devices
    btrfs_get_bdev_and_sb(&amp;amp;bdev_file)
     // EIO, btrfs_device_1-&amp;gt;bdev_file is not assigned,
     // which points to a freed memory area
    btrfs_device_2-&amp;gt;bdev_file = btrfs_get_bdev_and_sb(loop1)
   btrfs_fill_super
    open_ctree
     btrfs_free_extra_devids
      if (btrfs_device_1-&amp;gt;bdev_file)
       fput(btrfs_device_1-&amp;gt;bdev_file) // UAF !&lt;/p&gt;
&lt;p&gt;Fix it by setting &amp;#39;device-&amp;gt;bdev_file&amp;#39; as &amp;#39;NULL&amp;#39; after closing t…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/cve-2024-50217</guid>
    </item>
  </channel>
</rss>
