syzbot


possible deadlock in hfsplus_block_free (5)

Status: upstream: reported on 2026/01/03 08:07
Reported-by: syzbot+02a134d0550d5b01e370@syzkaller.appspotmail.com
First crash: 9d06h, last: 9d06h
Similar bugs (13)
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 584d 584d 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 79d 79d 0/3 upstream: reported on 2025/10/25 10:59
linux-4.14 possible deadlock in hfsplus_block_free hfsplus 4 10 1052d 1137d 0/1 upstream: reported on 2022/12/01 19:36
linux-5.15 possible deadlock in hfsplus_block_free (3) 4 2 313d 315d 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 1043d 1134d 0/1 upstream: reported on 2022/12/04 19:32
linux-6.1 possible deadlock in hfsplus_block_free (4) 4 1 116d 116d 0/3 auto-obsoleted due to no activity on 2025/12/27 09:21
upstream possible deadlock in hfsplus_block_free hfs 4 C inconclusive error 361 1d23h 1140d 0/29 upstream: reported C repro on 2022/11/29 08:32
linux-5.15 possible deadlock in hfsplus_block_free 4 20 811d 1015d 0/3 auto-obsoleted due to no activity on 2024/01/31 18:41
linux-6.1 possible deadlock in hfsplus_block_free (3) 4 4 267d 329d 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 584d 584d 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 737d 1001d 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 4d18h 4d18h 0/2 upstream: reported on 2026/01/07 20:23
linux-6.6 possible deadlock in hfsplus_block_free 4 1 116d 116d 0/2 auto-obsoleted due to no activity on 2025/12/26 20:38

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz-executor/4320 is trying to acquire lock:
ffff0000d95c58f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xb8/0x47c fs/hfsplus/bitmap.c:182

but task is already holding lock:
ffff0000f58d1548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x20c/0x970 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+0x190/0x1f38 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
       hfsplus_get_block+0x2bc/0x1154 fs/hfsplus/extents.c:260
       block_read_full_folio+0x2e4/0x97c fs/buffer.c:2271
       hfsplus_read_folio+0x28/0x38 fs/hfsplus/inode.c:28
       filemap_read_folio+0x130/0x37c mm/filemap.c:2490
       do_read_cache_folio+0x24c/0x544 mm/filemap.c:3659
       do_read_cache_page mm/filemap.c:3701 [inline]
       read_cache_page+0x6c/0x184 mm/filemap.c:3710
       read_mapping_page include/linux/pagemap.h:793 [inline]
       hfsplus_block_allocate+0xdc/0x7d8 fs/hfsplus/bitmap.c:37
       hfsplus_file_extend+0x73c/0x1324 fs/hfsplus/extents.c:466
       hfsplus_get_block+0x314/0x1154 fs/hfsplus/extents.c:245
       __block_write_begin_int+0x34c/0x13b8 fs/buffer.c:1991
       __block_write_begin fs/buffer.c:2041 [inline]
       block_write_begin fs/buffer.c:2102 [inline]
       cont_write_begin+0x548/0x780 fs/buffer.c:2456
       hfsplus_write_begin+0x98/0xe4 fs/hfsplus/inode.c:52
       cont_expand_zero fs/buffer.c:2383 [inline]
       cont_write_begin+0x268/0x780 fs/buffer.c:2446
       hfsplus_write_begin+0x98/0xe4 fs/hfsplus/inode.c:52
       generic_perform_write+0x230/0x4e4 mm/filemap.c:3862
       __generic_file_write_iter+0x130/0x250 mm/filemap.c:3960
       generic_file_write_iter+0xb4/0x2b0 mm/filemap.c:3989
       call_write_iter include/linux/fs.h:2265 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x5ac/0x7c4 fs/read_write.c:584
       ksys_pwrite64 fs/read_write.c:699 [inline]
       __do_sys_pwrite64 fs/read_write.c:709 [inline]
       __se_sys_pwrite64 fs/read_write.c:706 [inline]
       __arm64_sys_pwrite64+0x170/0x200 fs/read_write.c:706
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

-> #0 (&sbi->alloc_mutex){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain kernel/locking/lockdep.c:3825 [inline]
       __lock_acquire+0x293c/0x6544 kernel/locking/lockdep.c:5049
       lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662
       __mutex_lock_common+0x190/0x1f38 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
       hfsplus_block_free+0xb8/0x47c fs/hfsplus/bitmap.c:182
       hfsplus_free_extents+0x10c/0x880 fs/hfsplus/extents.c:360
       hfsplus_file_truncate+0x5e0/0x970 fs/hfsplus/extents.c:589
       hfsplus_delete_inode+0x164/0x210 fs/hfsplus/inode.c:-1
       hfsplus_unlink+0x3f8/0x664 fs/hfsplus/dir.c:405
       vfs_unlink+0x2e0/0x4f4 fs/namei.c:4330
       do_unlinkat+0x31c/0x4e8 fs/namei.c:4398
       __do_sys_unlinkat fs/namei.c:4441 [inline]
       __se_sys_unlinkat fs/namei.c:4434 [inline]
       __arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4434
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

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 ***

5 locks held by syz-executor/4320:
 #0: ffff0000c4934460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402
 #1: ffff0000fc3f1740 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline]
 #1: ffff0000fc3f1740 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: do_unlinkat+0x18c/0x4e8 fs/namei.c:4381
 #2: ffff0000f58d1740 (&sb->s_type->i_mutex_key#23){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #2: ffff0000f58d1740 (&sb->s_type->i_mutex_key#23){++++}-{3:3}, at: vfs_unlink+0xd0/0x4f4 fs/namei.c:4319
 #3: ffff0000d95c5998 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x140/0x664 fs/hfsplus/dir.c:370
 #4: ffff0000f58d1548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x20c/0x970 fs/hfsplus/extents.c:574

stack backtrace:
CPU: 1 PID: 4320 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048
 check_noncircular+0x240/0x2d4 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3090 [inline]
 check_prevs_add kernel/locking/lockdep.c:3209 [inline]
 validate_chain kernel/locking/lockdep.c:3825 [inline]
 __lock_acquire+0x293c/0x6544 kernel/locking/lockdep.c:5049
 lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662
 __mutex_lock_common+0x190/0x1f38 kernel/locking/mutex.c:603
 __mutex_lock kernel/locking/mutex.c:747 [inline]
 mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
 hfsplus_block_free+0xb8/0x47c fs/hfsplus/bitmap.c:182
 hfsplus_free_extents+0x10c/0x880 fs/hfsplus/extents.c:360
 hfsplus_file_truncate+0x5e0/0x970 fs/hfsplus/extents.c:589
 hfsplus_delete_inode+0x164/0x210 fs/hfsplus/inode.c:-1
 hfsplus_unlink+0x3f8/0x664 fs/hfsplus/dir.c:405
 vfs_unlink+0x2e0/0x4f4 fs/namei.c:4330
 do_unlinkat+0x31c/0x4e8 fs/namei.c:4398
 __do_sys_unlinkat fs/namei.c:4441 [inline]
 __se_sys_unlinkat fs/namei.c:4434 [inline]
 __arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4434
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: invalid extended attribute record
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/03 08:06 linux-6.1.y 50cbba13faa2 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_block_free
* Struck through repros no longer work on HEAD.