possible deadlock in hfsplus_block_free (3)

Status: upstream: reported on 2026/08/31 09:59
Reported-by: syzbot+cee12db642422214558f@syzkaller.appspotmail.com
First crash: 1h09m, last: 1h09m
Similar bugs (16)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in hfsplus_block_free (2) 4 4 814d 814d 0/3 auto-obsoleted due to no activity on 2024/09/15 13:42
linux-5.15 possible deadlock in hfsplus_block_free (4) 4 1 310d 310d 0/3 auto-obsoleted due to no activity on 2026/02/02 10:58
linux-4.14 possible deadlock in hfsplus_block_free hfsplus 4 10 1283d 1368d 0/1 upstream: reported on 2022/12/01 19:36
linux-6.1 possible deadlock in hfsplus_block_free (6) 4 4 97d 121d 0/3 upstream: reported on 2026/05/01 12:21
linux-6.1 possible deadlock in hfsplus_block_free (5) 4 1 240d 240d 0/3 auto-obsoleted due to no activity on 2026/04/13 08:07
linux-5.15 possible deadlock in hfsplus_block_free (3) 4 2 544d 546d 0/3 auto-obsoleted due to no activity on 2025/06/13 01:35
linux-4.19 possible deadlock in hfsplus_block_free hfsplus 4 20 1274d 1365d 0/1 upstream: reported on 2022/12/04 19:32
linux-6.1 possible deadlock in hfsplus_block_free (4) 4 1 347d 347d 0/3 auto-obsoleted due to no activity on 2025/12/27 09:21
upstream possible deadlock in hfsplus_block_free hfs 4 syz, C inconclusive error 404 1h27m 1371d 0/29 upstream: reported C repro on 2022/11/29 08:32
linux-5.15 possible deadlock in hfsplus_block_free 4 20 1042d 1246d 0/3 auto-obsoleted due to no activity on 2024/01/31 18:41
linux-5.15 possible deadlock in hfsplus_block_free (5) 4 8 92d 119d 0/3 upstream: reported on 2026/05/04 02:29
linux-6.1 possible deadlock in hfsplus_block_free (3) 4 4 498d 560d 0/3 auto-obsoleted due to no activity on 2025/07/29 00:39
linux-5.15 possible deadlock in hfsplus_block_free (2) 4 1 814d 814d 0/3 auto-obsoleted due to no activity on 2024/09/15 11:28
linux-6.1 possible deadlock in hfsplus_block_free 4 27 968d 1232d 0/3 auto-obsoleted due to no activity on 2024/04/14 19:02
linux-6.6 possible deadlock in hfsplus_block_free (2) 4 1 235d 235d 0/2 auto-obsoleted due to no activity on 2026/04/17 20:22
linux-6.6 possible deadlock in hfsplus_block_free 4 1 347d 347d 0/2 auto-obsoleted due to no activity on 2025/12/26 20:38

Sample crash report:
loop2: detected capacity change from 0 to 1024
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.206/6948 is trying to acquire lock:
ffff88802ab560f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xc3/0x4b0 fs/hfsplus/bitmap.c:182

but task is already holding lock:
ffff88807a8b6648 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2b7/0xb60 fs/hfsplus/extents.c:574

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       hfsplus_get_block+0x393/0x1520 fs/hfsplus/extents.c:260
       block_read_full_folio+0x47b/0xff0 fs/buffer.c:2406
       filemap_read_folio+0x16b/0x790 mm/filemap.c:2420
       do_read_cache_folio+0x485/0x7f0 mm/filemap.c:3809
       do_read_cache_page+0x32/0x260 mm/filemap.c:3875
       read_mapping_page include/linux/pagemap.h:892 [inline]
       hfsplus_block_allocate+0xe7/0x900 fs/hfsplus/bitmap.c:37
       hfsplus_file_extend+0xb92/0x1af0 fs/hfsplus/extents.c:466
       hfsplus_get_block+0x421/0x1520 fs/hfsplus/extents.c:245
       __block_write_begin_int+0x571/0x1b00 fs/buffer.c:2124
       __block_write_begin fs/buffer.c:2173 [inline]
       block_write_begin+0x9a/0x1e0 fs/buffer.c:2234
       cont_write_begin+0x5fd/0x800 fs/buffer.c:2591
       hfsplus_write_begin+0x8b/0xd0 fs/hfsplus/inode.c:52
       page_symlink+0x24f/0x3d0 fs/namei.c:5285
       hfsplus_symlink+0xca/0x230 fs/hfsplus/dir.c:449
       vfs_symlink+0x138/0x2b0 fs/namei.c:4528
       do_symlinkat+0x1ba/0x400 fs/namei.c:4554
       __do_sys_symlink fs/namei.c:4575 [inline]
       __se_sys_symlink fs/namei.c:4573 [inline]
       __x64_sys_symlink+0x7e/0x90 fs/namei.c:4573
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&sbi->alloc_mutex){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       hfsplus_block_free+0xc3/0x4b0 fs/hfsplus/bitmap.c:182
       hfsplus_free_extents+0x10d/0xa50 fs/hfsplus/extents.c:360
       hfsplus_file_truncate+0x75a/0xb60 fs/hfsplus/extents.c:589
       hfsplus_setattr+0x1b5/0x260 fs/hfsplus/inode.c:289
       notify_change+0xb05/0xde0 fs/attr.c:499
       do_truncate+0x1b0/0x240 fs/open.c:66
       handle_truncate fs/namei.c:3342 [inline]
       do_open fs/namei.c:3687 [inline]
       path_openat+0x2a7e/0x3270 fs/namei.c:3844
       do_filp_open+0x1f2/0x430 fs/namei.c:3871
       do_sys_openat2+0x134/0x1d0 fs/open.c:1422
       do_sys_open fs/open.c:1437 [inline]
       __do_sys_openat fs/open.c:1453 [inline]
       __se_sys_openat fs/open.c:1448 [inline]
       __x64_sys_openat+0x139/0x160 fs/open.c:1448
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&HFSPLUS_I(inode)->extents_lock);
                               lock(&sbi->alloc_mutex);
                               lock(&HFSPLUS_I(inode)->extents_lock);
  lock(&sbi->alloc_mutex);

 *** DEADLOCK ***

3 locks held by syz.2.206/6948:
 #0: ffff88807c8ca418 (sb_writers#23){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
 #1: ffff88807a8b6850 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #1: ffff88807a8b6850 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: do_truncate+0x19c/0x240 fs/open.c:64
 #2: ffff88807a8b6648 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2b7/0xb60 fs/hfsplus/extents.c:574

stack backtrace:
CPU: 1 PID: 6948 Comm: syz.2.206 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
 hfsplus_block_free+0xc3/0x4b0 fs/hfsplus/bitmap.c:182
 hfsplus_free_extents+0x10d/0xa50 fs/hfsplus/extents.c:360
 hfsplus_file_truncate+0x75a/0xb60 fs/hfsplus/extents.c:589
 hfsplus_setattr+0x1b5/0x260 fs/hfsplus/inode.c:289
 notify_change+0xb05/0xde0 fs/attr.c:499
 do_truncate+0x1b0/0x240 fs/open.c:66
 handle_truncate fs/namei.c:3342 [inline]
 do_open fs/namei.c:3687 [inline]
 path_openat+0x2a7e/0x3270 fs/namei.c:3844
 do_filp_open+0x1f2/0x430 fs/namei.c:3871
 do_sys_openat2+0x134/0x1d0 fs/open.c:1422
 do_sys_open fs/open.c:1437 [inline]
 __do_sys_openat fs/open.c:1453 [inline]
 __se_sys_openat fs/open.c:1448 [inline]
 __x64_sys_openat+0x139/0x160 fs/open.c:1448
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fcca3d9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fcca4c49028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fcca4025fa0 RCX: 00007fcca3d9e159
RDX: 0000000000101242 RSI: 0000200000000140 RDI: ffffffffffffff9c
RBP: 00007fcca3e35024 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000028e R11: 0000000000000246 R12: 0000000000000000
R13: 00007fcca4026038 R14: 00007fcca4025fa0 R15: 00007ffc962bed88
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/31 09:58 linux-6.6.y a4a971135a2f 2f52988a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in hfsplus_block_free
* Struck through repros no longer work on HEAD.