loop0: detected capacity change from 0 to 64
hfs: unable to locate alternate MDB
hfs: continuing without an alternate MDB
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.297/8773 is trying to acquire lock:
ffff88803f95c0a0 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1
but task is already holding lock:
ffff88803f95c0a0 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&tree->tree_lock#2/1);
lock(&tree->tree_lock#2/1);
*** DEADLOCK ***
May be due to missing lock nesting notation
locks held by syz.0.297/8773: 6, on CPU#1:
#0: ffff88803b944d28 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x11e/0x160 fs/file.c:1413
#1: ffff88803dc84528 (sb_writers#16){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2765 [inline]
#1: ffff88803dc84528 (sb_writers#16){.+.+}-{0:0}, at: vfs_write+0x231/0xbb0 fs/read_write.c:663
#2: ffff8880626f2ff0 (&sb->s_type->i_mutex_key#43){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline]
#2: ffff8880626f2ff0 (&sb->s_type->i_mutex_key#43){+.+.}-{4:4}, at: generic_file_write_iter+0x83/0x330 mm/filemap.c:4547
#3: ffff8880626f2e18 (&HFS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xf9/0x1680 fs/hfs/extent.c:403
#4: ffff88803f95c0a0 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1
#5: ffff8880626f6218 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xf9/0x1680 fs/hfs/extent.c:403
stack backtrace:
CPU: 1 UID: 0 PID: 8773 Comm: syz.0.297 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_deadlock_bug+0x27a/0x290 kernel/locking/lockdep.c:3085
check_deadlock kernel/locking/lockdep.c:3137 [inline]
validate_chain kernel/locking/lockdep.c:3939 [inline]
__lock_acquire+0x25db/0x2de0 kernel/locking/lockdep.c:5288
lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942
__mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline]
mutex_lock_nested+0x55/0x1d0 kernel/locking/rtmutex_api.c:580
hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1
hfs_ext_read_extent fs/hfs/extent.c:206 [inline]
hfs_extend_file+0x367/0x1680 fs/hfs/extent.c:407
hfs_bmap_reserve+0x108/0x430 fs/hfs/btree.c:402
__hfs_ext_write_extent+0x200/0x620 fs/hfs/extent.c:121
__hfs_ext_cache_extent+0x6e/0x9b0 fs/hfs/extent.c:180
hfs_ext_read_extent fs/hfs/extent.c:208 [inline]
hfs_extend_file+0x3ad/0x1680 fs/hfs/extent.c:407
hfs_get_block+0x401/0xbf0 fs/hfs/extent.c:359
__block_write_begin_int+0x6c1/0x1930 fs/buffer.c:2043
block_write_begin fs/buffer.c:2157 [inline]
cont_write_begin+0x71b/0xac0 fs/buffer.c:2519
hfs_write_begin+0x123/0x1c0 fs/hfs/inode.c:62
generic_perform_write+0x2ad/0x8a0 mm/filemap.c:4407
generic_file_write_iter+0xaf/0x330 mm/filemap.c:4550
new_sync_write fs/read_write.c:575 [inline]
vfs_write+0x61e/0xbb0 fs/read_write.c:667
ksys_write+0x156/0x270 fs/read_write.c:719
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcf7d669559
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:00007fcf7b8ae028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fcf7d8e5fa0 RCX: 00007fcf7d669559
RDX: 00000000fffffdef RSI: 0000200000000800 RDI: 0000000000000004
RBP: 00007fcf7d6f8136 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fcf7d8e6038 R14: 00007fcf7d8e5fa0 R15: 00007fff0c4a7528
------------[ cut here ]------------
rtmutex deadlock detected
WARNING: kernel/locking/rtmutex.c:1698 at rt_mutex_handle_deadlock+0x21/0xb0 kernel/locking/rtmutex.c:1698, CPU#1: syz.0.297/8773
Modules linked in:
CPU: 1 UID: 0 PID: 8773 Comm: syz.0.297 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:rt_mutex_handle_deadlock+0x21/0xb0 kernel/locking/rtmutex.c:1698
Code: 90 90 90 90 90 90 90 90 90 41 57 41 56 41 55 41 54 53 83 ff dd 0f 85 81 00 00 00 48 89 f7 e8 76 42 01 00 48 8d 3d 1f 4d 5e 05 <67> 48 0f b9 3a 4c 8d 3d 00 00 00 00 65 48 8b 1d d3 33 57 08 4c 8d
RSP: 0018:ffffc90005a7ef10 EFLAGS: 00010286
RAX: 8000000000000000 RBX: 00000000ffffffdd RCX: ffffffff9adb1a01
RDX: 0000000000000001 RSI: ffffffff8bed2560 RDI: ffffffff90d8d940
RBP: ffffc90005a7f0a8 R08: ffffffff90d5c1bf R09: 1ffffffff21ab837
R10: dffffc0000000000 R11: fffffbfff21ab838 R12: 1ffff92000b4fdf0
R13: ffffffff8b7a8662 R14: ffff88803f95c048 R15: dffffc0000000000
FS: 00007fcf7b8ae6c0(0000) GS:ffff888124804000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c37a489 CR3: 000000005a592000 CR4: 00000000003526f0
Call Trace:
__rt_mutex_slowlock kernel/locking/rtmutex.c:1760 [inline]
__rt_mutex_slowlock_locked kernel/locking/rtmutex.c:1787 [inline]
rt_mutex_slowlock+0x73e/0x780 kernel/locking/rtmutex.c:1827
__rt_mutex_lock kernel/locking/rtmutex.c:1842 [inline]
__mutex_lock_common kernel/locking/rtmutex_api.c:562 [inline]
mutex_lock_nested+0x163/0x1d0 kernel/locking/rtmutex_api.c:580
hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1
hfs_ext_read_extent fs/hfs/extent.c:206 [inline]
hfs_extend_file+0x367/0x1680 fs/hfs/extent.c:407
hfs_bmap_reserve+0x108/0x430 fs/hfs/btree.c:402
__hfs_ext_write_extent+0x200/0x620 fs/hfs/extent.c:121
__hfs_ext_cache_extent+0x6e/0x9b0 fs/hfs/extent.c:180
hfs_ext_read_extent fs/hfs/extent.c:208 [inline]
hfs_extend_file+0x3ad/0x1680 fs/hfs/extent.c:407
hfs_get_block+0x401/0xbf0 fs/hfs/extent.c:359
__block_write_begin_int+0x6c1/0x1930 fs/buffer.c:2043
block_write_begin fs/buffer.c:2157 [inline]
cont_write_begin+0x71b/0xac0 fs/buffer.c:2519
hfs_write_begin+0x123/0x1c0 fs/hfs/inode.c:62
generic_perform_write+0x2ad/0x8a0 mm/filemap.c:4407
generic_file_write_iter+0xaf/0x330 mm/filemap.c:4550
new_sync_write fs/read_write.c:575 [inline]
vfs_write+0x61e/0xbb0 fs/read_write.c:667
ksys_write+0x156/0x270 fs/read_write.c:719
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcf7d669559
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:00007fcf7b8ae028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fcf7d8e5fa0 RCX: 00007fcf7d669559
RDX: 00000000fffffdef RSI: 0000200000000800 RDI: 0000000000000004
RBP: 00007fcf7d6f8136 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fcf7d8e6038 R14: 00007fcf7d8e5fa0 R15: 00007fff0c4a7528
----------------
Code disassembly (best guess):
0: 90 nop
1: 90 nop
2: 90 nop
3: 90 nop
4: 90 nop
5: 90 nop
6: 90 nop
7: 90 nop
8: 90 nop
9: 41 57 push %r15
b: 41 56 push %r14
d: 41 55 push %r13
f: 41 54 push %r12
11: 53 push %rbx
12: 83 ff dd cmp $0xffffffdd,%edi
15: 0f 85 81 00 00 00 jne 0x9c
1b: 48 89 f7 mov %rsi,%rdi
1e: e8 76 42 01 00 call 0x14299
23: 48 8d 3d 1f 4d 5e 05 lea 0x55e4d1f(%rip),%rdi # 0x55e4d49
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: 4c 8d 3d 00 00 00 00 lea 0x0(%rip),%r15 # 0x36
36: 65 48 8b 1d d3 33 57 mov %gs:0x85733d3(%rip),%rbx # 0x8573411
3d: 08
3e: 4c rex.WR
3f: 8d .byte 0x8d