<?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://db.gcve.eu</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 07:33:24 +0000</lastBuildDate>
    <item>
      <title>CVE-2024-35784 — btrfs: fix deadlock with fiemap and extent locking</title>
      <link>https://db.gcve.eu/vuln/cve-2024-35784</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 deadlock with fiemap and extent locking&lt;/p&gt;
&lt;p&gt;While working on the patchset to remove extent locking I got a lockdep
splat with fiemap and pagefaulting with my new extent lock replacement
lock.&lt;/p&gt;
&lt;p&gt;This deadlock exists with our normal code, we just don&amp;#39;t have lockdep
annotations with the extent locking so we&amp;#39;ve never noticed it.&lt;/p&gt;
&lt;p&gt;Since we&amp;#39;re copying the fiemap extent to user space on every iteration
we have the chance of pagefaulting.  Because we hold the extent lock for
the entire range we could mkwrite into a range in the file that we have
mmap&amp;#39;ed.  This would deadlock with the following stack trace&lt;/p&gt;
&lt;p&gt;[&amp;lt;0&amp;gt;] lock_extent+0x28d/0x2f0
[&amp;lt;0&amp;gt;] btrfs_page_mkwrite+0x273/0x8a0
[&amp;lt;0&amp;gt;] do_page_mkwrite+0x50/0xb0
[&amp;lt;0&amp;gt;] do_fault+0xc1/0x7b0
[&amp;lt;0&amp;gt;] __handle_mm_fault+0x2fa/0x460
[&amp;lt;0&amp;gt;] handle_mm_fault+0xa4/0x330
[&amp;lt;0&amp;gt;] do_user_addr_fault+0x1f4/0x800
[&amp;lt;0&amp;gt;] exc_page_fault+0x7c/0x1e0
[&amp;lt;0&amp;gt;] asm_exc_page_fault+0x26/0x30
[&amp;lt;0&amp;gt;] rep_movs_alternative+0x33/0x70
[&amp;lt;0&amp;gt;] _copy_to_user+0x49/0x70
[&amp;lt;0&amp;gt;] fiemap_fill_next_extent+0xc8/0x120
[&amp;lt;0&amp;gt;] emit_fiemap_extent+0x4d/0xa0
[&amp;lt;0&amp;gt;] extent_fiemap+0x7f8/0xad0
[&amp;lt;0&amp;gt;] btrfs_fiemap+0x49/0x80
[&amp;lt;0&amp;gt;] __x64_sys_ioctl+0x3e1/0xb50
[&amp;lt;0&amp;gt;] do_syscall_64+0x94/0x1a0
[&amp;lt;0&amp;gt;] entry_SYSCALL_64_after_hwframe+0x6e/0x76&lt;/p&gt;
&lt;p&gt;I wrote an fstest to reproduce this deadlock without my replacement lock
and verified that the deadlock exists with our existing locking.&lt;/p&gt;
&lt;p&gt;To fix this simply don&amp;#39;t take the extent lock for the entire du…&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 deadlock with fiemap and extent locking&lt;/p&gt;
&lt;p&gt;While working on the patchset to remove extent locking I got a lockdep
splat with fiemap and pagefaulting with my new extent lock replacement
lock.&lt;/p&gt;
&lt;p&gt;This deadlock exists with our normal code, we just don&amp;#39;t have lockdep
annotations with the extent locking so we&amp;#39;ve never noticed it.&lt;/p&gt;
&lt;p&gt;Since we&amp;#39;re copying the fiemap extent to user space on every iteration
we have the chance of pagefaulting.  Because we hold the extent lock for
the entire range we could mkwrite into a range in the file that we have
mmap&amp;#39;ed.  This would deadlock with the following stack trace&lt;/p&gt;
&lt;p&gt;[&amp;lt;0&amp;gt;] lock_extent+0x28d/0x2f0
[&amp;lt;0&amp;gt;] btrfs_page_mkwrite+0x273/0x8a0
[&amp;lt;0&amp;gt;] do_page_mkwrite+0x50/0xb0
[&amp;lt;0&amp;gt;] do_fault+0xc1/0x7b0
[&amp;lt;0&amp;gt;] __handle_mm_fault+0x2fa/0x460
[&amp;lt;0&amp;gt;] handle_mm_fault+0xa4/0x330
[&amp;lt;0&amp;gt;] do_user_addr_fault+0x1f4/0x800
[&amp;lt;0&amp;gt;] exc_page_fault+0x7c/0x1e0
[&amp;lt;0&amp;gt;] asm_exc_page_fault+0x26/0x30
[&amp;lt;0&amp;gt;] rep_movs_alternative+0x33/0x70
[&amp;lt;0&amp;gt;] _copy_to_user+0x49/0x70
[&amp;lt;0&amp;gt;] fiemap_fill_next_extent+0xc8/0x120
[&amp;lt;0&amp;gt;] emit_fiemap_extent+0x4d/0xa0
[&amp;lt;0&amp;gt;] extent_fiemap+0x7f8/0xad0
[&amp;lt;0&amp;gt;] btrfs_fiemap+0x49/0x80
[&amp;lt;0&amp;gt;] __x64_sys_ioctl+0x3e1/0xb50
[&amp;lt;0&amp;gt;] do_syscall_64+0x94/0x1a0
[&amp;lt;0&amp;gt;] entry_SYSCALL_64_after_hwframe+0x6e/0x76&lt;/p&gt;
&lt;p&gt;I wrote an fstest to reproduce this deadlock without my replacement lock
and verified that the deadlock exists with our existing locking.&lt;/p&gt;
&lt;p&gt;To fix this simply don&amp;#39;t take the extent lock for the entire du…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://db.gcve.eu/vuln/cve-2024-35784</guid>
    </item>
  </channel>
</rss>
