possible deadlock in hfsplus_file_extend (5)

Status: upstream: reported on 2026/12/02 22:53
Reported-by: syzbot+56b797959eb1fc8180bc@syzkaller.appspotmail.com
First crash: 2h08m, last: 2h08m
▶ ▼ Similar bugs (13)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in hfsplus_file_extend (3) 4 4 406d 409d 0/3 auto-obsoleted due to no activity on 2026/01/30 04:03
linux-6.1 possible deadlock in hfsplus_file_extend origin:upstream missing-backport 4 syz, C done 2760 851d 1360d 3/3 fixed on 2024/09/08 06:54
linux-5.15 possible deadlock in hfsplus_file_extend (3) 4 10 385d 407d 0/3 auto-obsoleted due to no activity on 2026/01/21 08:03
upstream possible deadlock in hfsplus_file_extend (2) prio:normal hfs 4 syz, C inconclusive error 1186 12m 751d 0/30 upstream: reported C repro on 2024/11/11 11:50
linux-5.15 possible deadlock in hfsplus_file_extend (2) 4 7 729d 780d 0/3 auto-obsoleted due to no activity on 2025/03/13 03:31
linux-4.14 possible deadlock in hfsplus_file_extend hfsplus 4 syz, C 3 1368d 1434d 0/1 upstream: reported C repro on 2022/12/29 06:07
linux-6.6 possible deadlock in hfsplus_file_extend origin:upstream 4 syz, C error 9 41m 412d 0/2 upstream: reported C repro on 2025/10/16 15:40
linux-5.15 possible deadlock in hfsplus_file_extend missing-backport origin:lts-only 4 syz, C done 3439 835d 1362d 3/3 fixed on 2024/09/23 09:27
linux-6.1 possible deadlock in hfsplus_file_extend (4) origin:lts-only 4 syz, C error 22 44d 294d 0/3 upstream: reported C repro on 2026/02/11 15:48
linux-4.19 possible deadlock in hfsplus_file_extend hfsplus 4 syz, C 258 1367d 1467d 0/1 upstream: reported C repro on 2022/11/26 10:00
linux-5.15 possible deadlock in hfsplus_file_extend (4) 4 3 294d 294d 0/3 auto-obsoleted due to no activity on 2026/05/22 01:53
linux-6.1 possible deadlock in hfsplus_file_extend (2) 4 2 689d 689d 0/3 auto-obsoleted due to no activity on 2025/04/22 11:08
upstream possible deadlock in hfsplus_file_extend hfs 4 syz, C error done 31659 779d 1467d 28/30 fixed on 2024/10/21 12:45

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.3.51/4474 is trying to acquire lock:
ffff8880790b0e08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1ca/0x1a40 fs/hfsplus/extents.c:457

but task is already holding lock:
ffff888025a2c0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&tree->tree_lock/1){+.+.}-{3:3}
:
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28
       hfsplus_file_truncate+0x3ad/0xb80 fs/hfsplus/extents.c:582
       hfsplus_delete_inode+0x17c/0x230 fs/hfsplus/inode.c:-1
       hfsplus_unlink+0x52b/0x800 fs/hfsplus/dir.c:399
       vfs_unlink+0x376/0x600 fs/namei.c:4331
       do_unlinkat+0x391/0x710 fs/namei.c:4399
       __do_sys_unlink fs/namei.c:4447 [inline]
       __se_sys_unlink fs/namei.c:4445 [inline]
       __x64_sys_unlink+0x45/0x50 fs/namei.c:4445
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (
&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3125 [inline]
       check_prevs_add kernel/locking/lockdep.c:3244 [inline]
       validate_chain kernel/locking/lockdep.c:3860 [inline]
       __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134
       lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       hfsplus_file_extend+0x1ca/0x1a40 fs/hfsplus/extents.c:457
       hfsplus_bmap_reserve+0x107/0x510 fs/hfsplus/btree.c:360
       __hfsplus_ext_write_extent+0x28d/0x5d0 fs/hfsplus/extents.c:104
       __hfsplus_ext_cache_extent+0x81/0xbd0 fs/hfsplus/extents.c:188
       hfsplus_ext_read_extent fs/hfsplus/extents.c:220 [inline]
       hfsplus_file_extend+0x4b9/0x1a40 fs/hfsplus/extents.c:461
       hfsplus_get_block+0x41d/0x1520 fs/hfsplus/extents.c:247
       __block_write_begin_int+0x565/0x15d0 fs/buffer.c:2012
       __block_write_begin fs/buffer.c:2062 [inline]
       block_write_begin fs/buffer.c:2122 [inline]
       cont_write_begin+0x598/0x7b0 fs/buffer.c:2471
       hfsplus_write_begin+0x92/0xe0 fs/hfsplus/inode.c:53
       generic_perform_write+0x2b6/0x550 mm/filemap.c:3793
       __generic_file_write_iter+0x261/0x4e0 mm/filemap.c:3920
       generic_file_write_iter+0xa6/0x1b0 mm/filemap.c:3952
       call_write_iter include/linux/fs.h:2191 [inline]
       aio_write+0x54a/0x780 fs/aio.c:1606
       __io_submit_one fs/aio.c:-1 [inline]
       io_submit_one+0x6d2/0x1310 fs/aio.c:2030
       __do_sys_io_submit fs/aio.c:2089 [inline]
       __se_sys_io_submit+0x19d/0x310 fs/aio.c:2059
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&tree->tree_lock/1);
                               lock(&HFSPLUS_I(inode)->extents_lock
);
                               lock(&tree->tree_lock/1);
  lock(
&HFSPLUS_I(inode)->extents_lock);

 *** DEADLOCK ***

3 locks held by syz.3.51/4474:
 #0: ffff8880790b3d30
 (&sb->s_type->i_mutex_key#23){++++}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline]
 (&sb->s_type->i_mutex_key#23){++++}-{3:3}, at: generic_file_write_iter+0x7e/0x1b0 mm/filemap.c:3949
 #1: ffff8880790b3b88
 (&hip->extents_lock
){+.+.}-{3:3}, at: hfsplus_file_extend+0x1ca/0x1a40 fs/hfsplus/extents.c:457
 #2: ffff888025a2c0b0 (&tree->tree_lock/1
){+.+.}-{3:3}, at: hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28

stack backtrace:
CPU: 0 PID: 4474 Comm: syz.3.51 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3125 [inline]
 check_prevs_add kernel/locking/lockdep.c:3244 [inline]
 validate_chain kernel/locking/lockdep.c:3860 [inline]
 __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134
 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751
 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 hfsplus_file_extend+0x1ca/0x1a40 fs/hfsplus/extents.c:457
 hfsplus_bmap_reserve+0x107/0x510 fs/hfsplus/btree.c:360
 __hfsplus_ext_write_extent+0x28d/0x5d0 fs/hfsplus/extents.c:104
 __hfsplus_ext_cache_extent+0x81/0xbd0 fs/hfsplus/extents.c:188
 hfsplus_ext_read_extent fs/hfsplus/extents.c:220 [inline]
 hfsplus_file_extend+0x4b9/0x1a40 fs/hfsplus/extents.c:461
 hfsplus_get_block+0x41d/0x1520 fs/hfsplus/extents.c:247
 __block_write_begin_int+0x565/0x15d0 fs/buffer.c:2012
 __block_write_begin fs/buffer.c:2062 [inline]
 block_write_begin fs/buffer.c:2122 [inline]
 cont_write_begin+0x598/0x7b0 fs/buffer.c:2471
 hfsplus_write_begin+0x92/0xe0 fs/hfsplus/inode.c:53
 generic_perform_write+0x2b6/0x550 mm/filemap.c:3793
 __generic_file_write_iter+0x261/0x4e0 mm/filemap.c:3920
 generic_file_write_iter+0xa6/0x1b0 mm/filemap.c:3952
 call_write_iter include/linux/fs.h:2191 [inline]
 aio_write+0x54a/0x780 fs/aio.c:1606
 __io_submit_one fs/aio.c:-1 [inline]
 io_submit_one+0x6d2/0x1310 fs/aio.c:2030
 __do_sys_io_submit fs/aio.c:2089 [inline]
 __se_sys_io_submit+0x19d/0x310 fs/aio.c:2059
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7faed6926c99
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:00007faed4b73028 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1
RAX: ffffffffffffffda RBX: 00007faed6bb2fa0 RCX: 00007faed6926c99
RDX: 0000200000000540 RSI: 000000000000003b RDI: 00007faed6b84000
RBP: 00007faed69b818b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007faed6bb3038 R14: 00007faed6bb2fa0 R15: 00007ffecc769798
 </TASK>
aio_complete: ffff888067ca4000[1]: ffff88807cf37140: 00002000000000c0 25 16fea 0
aio_complete: added to ring ffff88807cf37140 at [1]
kcov: kcov_task_exit: t = ffff888079ef8000, kcov->t = ffff888079ef8000
kernfs backing_file: removing
kernfs offset: removing
kernfs sizelimit: removing
kernfs autoclear: removing
kernfs partscan: removing
kernfs dio: removing
kernfs loop: removing
kobject: 'loop3' (ffff888017cd6a00): kobject_uevent_env
kobject: 'loop3' (ffff888017cd6a00): fill_kobj_path: path = '/devices/virtual/block/loop3'
kobject: 'loop3' (ffff888017cd6a00): kobject_uevent_env
kobject: 'loop3' (ffff888017cd6a00): fill_kobj_path: path = '/devices/virtual/block/loop3'
ffff888063b3c000 name hci4 bus 0
hci4 ffff888063b3c000
hci4: err 0x13
hci4: cancelling interleave scan
hci4 state 0 -> 0
All LE pending actions cleared
hdev hci4

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/12/02 22:53 linux-5.15.y 9bdc23a21e3d 35891725 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_extend
* Struck through repros no longer work on HEAD.