loop3: detected capacity change from 0 to 1024 ====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc4-syzkaller-00274-g3b68086599f8 #0 Not tainted ------------------------------------------------------ syz-executor.3/9573 is trying to acquire lock: ffff8880673dd8f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_allocate+0xe9/0x990 fs/hfsplus/bitmap.c:35 but task is already holding lock: ffff88801d306d08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1c1/0xfe0 fs/hfsplus/extents.c:457 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:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 block_read_full_folio+0x38f/0xa70 fs/buffer.c:2384 filemap_read_folio+0xe7/0x2c0 mm/filemap.c:2331 do_read_cache_folio+0x207/0x550 mm/filemap.c:3747 do_read_cache_page mm/filemap.c:3813 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3822 read_mapping_page include/linux/pagemap.h:888 [inline] hfsplus_block_allocate+0x148/0x990 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0x440/0xfe0 fs/hfsplus/extents.c:468 hfsplus_get_block+0x1ae/0x9e0 fs/hfsplus/extents.c:245 __block_write_begin_int+0x4fb/0x16e0 fs/buffer.c:2105 __block_write_begin fs/buffer.c:2154 [inline] block_write_begin+0xb1/0x4a0 fs/buffer.c:2213 cont_write_begin+0x53d/0x740 fs/buffer.c:2567 hfsplus_write_begin+0x87/0x150 fs/hfsplus/inode.c:47 page_symlink+0x356/0x450 fs/namei.c:5229 hfsplus_symlink+0xd3/0x2b0 fs/hfsplus/dir.c:449 vfs_symlink fs/namei.c:4481 [inline] vfs_symlink+0x3e8/0x630 fs/namei.c:4465 do_symlinkat+0x263/0x310 fs/namei.c:4507 __do_sys_symlink fs/namei.c:4528 [inline] __se_sys_symlink fs/namei.c:4526 [inline] __ia32_sys_symlink+0x78/0xa0 fs/namei.c:4526 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #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+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_block_allocate+0xe9/0x990 fs/hfsplus/bitmap.c:35 hfsplus_file_extend+0x440/0xfe0 fs/hfsplus/extents.c:468 hfsplus_bmap_reserve+0x31c/0x410 fs/hfsplus/btree.c:358 hfsplus_create_cat+0x213/0x10e0 fs/hfsplus/catalog.c:272 hfsplus_fill_super+0x16ce/0x1bc0 fs/hfsplus/super.c:566 mount_bdev+0x1e3/0x2d0 fs/super.c:1658 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e1/0x1f10 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e 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 *** 4 locks held by syz-executor.3/9573: #0: ffff888070c500e0 (&type->s_umount_key#48/1){+.+.}-{3:3}, at: alloc_super+0x23d/0xbd0 fs/super.c:343 #1: ffff8880673dd998 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_fill_super+0x1657/0x1bc0 fs/hfsplus/super.c:559 #2: ffff88805592c0b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x1a7/0x200 fs/hfsplus/bfind.c:30 #3: ffff88801d306d08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1c1/0xfe0 fs/hfsplus/extents.c:457 stack backtrace: CPU: 1 PID: 9573 Comm: syz-executor.3 Not tainted 6.9.0-rc4-syzkaller-00274-g3b68086599f8 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/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+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_block_allocate+0xe9/0x990 fs/hfsplus/bitmap.c:35 hfsplus_file_extend+0x440/0xfe0 fs/hfsplus/extents.c:468 hfsplus_bmap_reserve+0x31c/0x410 fs/hfsplus/btree.c:358 hfsplus_create_cat+0x213/0x10e0 fs/hfsplus/catalog.c:272 hfsplus_fill_super+0x16ce/0x1bc0 fs/hfsplus/super.c:566 mount_bdev+0x1e3/0x2d0 fs/super.c:1658 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e1/0x1f10 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf72b4579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5ea6400 EFLAGS: 00000292 ORIG_RAX: 0000000000000015 RAX: ffffffffffffffda RBX: 00000000f5ea6460 RCX: 0000000020002380 RDX: 0000000020000000 RSI: 000000000080000c RDI: 00000000f5ea64a0 RBP: 00000000f5ea6460 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi