program: syz_mount_image$hfsplus(&(0x7f0000000040), &(0x7f0000000080)='./file1\x00', 0x400, &(0x7f0000000140)=ANY=[], 0x1, 0x694, &(0x7f0000001100)="$eJzs3U1sHGf9B/DvbnbX3vz/Sp02SQOqRNRIBRGROLGSYi4NCKFIVKgqB8TRSpzGyiatHBc5EYLwfuDCoXeKRG5cQOIeVM7AqVcfKyFx6SmAxKKZnbXXr9l1Yq8tPp9odp5nnpd5nt/M7OzOKnKA/1nXzqXxOLVcO/fmcpFfeTTTWXk0c6efTjKRpJ40eqvU7ia1j5Kr6S35TLGx6q623X4+WJh9++NPVz7p5RrVUtav79Rukyv1LTY+rJacSXKkWj+Ddf1d39Bfa+TuaqszLAJ2th84GLdmku463z21VvJUw1+3wIFVK++bm6/5qeRoksnqc0Dvrti7Zx9qD8c9AAAAANgHL/yy/Ap/bNzjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgMOk9/f/i1W51PvpM6n1//5/q9qWKn2oPR73AAAAAAAAAABgdN/8/w0bPvckT7KcY/18t1b+5v9qmTlRvv5f3s+9zGcx57OcuSxlKYu5mGSqLG+Wr63luaWlxYtDtLy02jIDLS8NOYP27icPAAAAAAAAAIdFY/QmP861td//AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgIKglR3qrcjnRT0+l3kgymaRV1HuY/LWfPpB+/afBXPff3dKmao/3c0wAAAAwJi88yZMs51g/362V3/lPld/7J/N+7mYpC1lKJ/O5UT4L6H3rr688mumsPJq5Uyyb+/3qP0YaRtljes8ett7z6bJGOzezUG45n+t5N53cSL1sWTjdH8/W4/pRMabaG5UhR3ajWhcz/1WaI81qN2pD15wqI1KMqBeR6aptEY3jO0dixKPT31M/9hdTX33yc+J5xny5t3r9t711MZ+fjxSTvbYxEpcGzr5TK6ntEInk83/83Xdude7enrh579zBmdIIJgaeoG2MxMxAJF7e+ZxIM1Ukbh3WSAyaLiNxcjV/Ld/It3MuZ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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcEhdOzdRpc5PF68rj2Y6xdJPr1Ysq9WT1L6f1D5Krqa3ZGqgu9p2+/lgYfbtjz9d+aSXa1RLWb++rl1zN7N4WC05k+RItR40+Qz9Xa/WuxpZqbY6wyJgZ/uBg3H7bwAAAP//2wMQAg==") r0 = creat(&(0x7f0000000100)='./file1\x00', 0x0) io_setup(0x202, &(0x7f0000000200)=0x0) io_submit(r1, 0x3b, &(0x7f0000000540)=[&(0x7f00000000c0)={0x25, 0xe7030000, 0x0, 0x1, 0x0, r0, &(0x7f0000000000), 0x70000}]) [ 75.836401][ T5336] Bluetooth: hci0: command tx timeout [ 75.921751][ T5357] loop0: detected capacity change from 0 to 1024 [ 76.031308][ T5357] [ 76.032514][ T5357] ============================================ [ 76.035292][ T5357] WARNING: possible recursive locking detected [ 76.038050][ T5357] 6.17.0-rc1-syzkaller-00036-gdfc0f6373094 #0 Not tainted [ 76.041256][ T5357] -------------------------------------------- [ 76.044107][ T5357] syz.0.0/5357 is trying to acquire lock: [ 76.046878][ T5357] ffff888052e50108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 76.052604][ T5357] [ 76.052604][ T5357] but task is already holding lock: [ 76.055842][ T5357] ffff888052e52988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 76.060193][ T5357] [ 76.060193][ T5357] other info that might help us debug this: [ 76.063822][ T5357] Possible unsafe locking scenario: [ 76.063822][ T5357] [ 76.067496][ T5357] CPU0 [ 76.069066][ T5357] ---- [ 76.070535][ T5357] lock(&HFSPLUS_I(inode)->extents_lock); [ 76.073123][ T5357] lock(&HFSPLUS_I(inode)->extents_lock); [ 76.075630][ T5357] [ 76.075630][ T5357] *** DEADLOCK *** [ 76.075630][ T5357] [ 76.078978][ T5357] May be due to missing lock nesting notation [ 76.078978][ T5357] [ 76.082530][ T5357] 3 locks held by syz.0.0/5357: [ 76.084566][ T5357] #0: ffff888052e52b78 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: generic_file_write_iter+0xeb/0x550 [ 76.089080][ T5357] #1: ffff888052e52988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 76.094136][ T5357] #2: ffff88803676a0b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x15a/0x1d0 [ 76.098459][ T5357] [ 76.098459][ T5357] stack backtrace: [ 76.101068][ T5357] CPU: 0 UID: 0 PID: 5357 Comm: syz.0.0 Not tainted 6.17.0-rc1-syzkaller-00036-gdfc0f6373094 #0 PREEMPT(full) [ 76.101080][ T5357] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 76.101085][ T5357] Call Trace: [ 76.101092][ T5357] [ 76.101098][ T5357] dump_stack_lvl+0x189/0x250 [ 76.101116][ T5357] ? __pfx_dump_stack_lvl+0x10/0x10 [ 76.101130][ T5357] ? __pfx__printk+0x10/0x10 [ 76.101148][ T5357] ? print_lock_name+0xde/0x100 [ 76.101165][ T5357] print_deadlock_bug+0x28b/0x2a0 [ 76.101178][ T5357] validate_chain+0x1a3f/0x2140 [ 76.101186][ T5357] ? __bfs+0x154/0x2a0 [ 76.101196][ T5357] ? check_path+0x21/0x40 [ 76.101205][ T5357] ? look_up_lock_class+0x74/0x170 [ 76.101265][ T5357] ? register_lock_class+0x51/0x320 [ 76.101283][ T5357] __lock_acquire+0xab9/0xd20 [ 76.101302][ T5357] ? hfsplus_file_extend+0x1fc/0x1990 [ 76.101314][ T5357] lock_acquire+0x120/0x360 [ 76.101329][ T5357] ? hfsplus_file_extend+0x1fc/0x1990 [ 76.101343][ T5357] __mutex_lock+0x187/0x1360 [ 76.101356][ T5357] ? hfsplus_file_extend+0x1fc/0x1990 [ 76.101369][ T5357] ? check_path+0x21/0x40 [ 76.101380][ T5357] ? check_noncircular+0xe0/0x160 [ 76.101393][ T5357] ? hfsplus_file_extend+0x1fc/0x1990 [ 76.101404][ T5357] ? lockdep_unlock+0x89/0x120 [ 76.101420][ T5357] ? __pfx___mutex_lock+0x10/0x10 [ 76.101434][ T5357] hfsplus_file_extend+0x1fc/0x1990 [ 76.101441][ T5357] ? __lock_acquire+0xab9/0xd20 [ 76.101452][ T5357] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 76.101459][ T5357] ? __pfx___mutex_trylock_common+0x10/0x10 [ 76.101467][ T5357] ? __se_sys_io_submit+0x185/0x2f0 [ 76.101475][ T5357] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 76.101483][ T5357] ? rcu_is_watching+0x15/0xb0 [ 76.101489][ T5357] ? trace_contention_end+0x39/0x120 [ 76.101496][ T5357] ? __mutex_lock+0x335/0x1360 [ 76.101505][ T5357] ? hfsplus_brec_find+0x191/0x500 [ 76.101515][ T5357] hfsplus_bmap_reserve+0x122/0x500 [ 76.101527][ T5357] __hfsplus_ext_write_extent+0x28d/0x5b0 [ 76.101538][ T5357] __hfsplus_ext_cache_extent+0x89/0xe30 [ 76.101551][ T5357] hfsplus_file_extend+0x444/0x1990 [ 76.101565][ T5357] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 76.101577][ T5357] ? clean_bdev_aliases+0x5c9/0x6b0 [ 76.101596][ T5357] ? __pfx_clean_bdev_aliases+0x10/0x10 [ 76.101612][ T5357] hfsplus_get_block+0x411/0x1530 [ 76.101620][ T5357] ? __pfx_hfsplus_get_block+0x10/0x10 [ 76.101627][ T5357] ? do_raw_spin_unlock+0x4d/0x240 [ 76.101635][ T5357] ? _raw_spin_unlock+0x28/0x50 [ 76.101643][ T5357] __block_write_begin_int+0x6b2/0x1900 [ 76.101651][ T5357] ? folio_add_lru+0x1b2/0x3d0 [ 76.101662][ T5357] ? __pfx_hfsplus_get_block+0x10/0x10 [ 76.101669][ T5357] ? __pfx___block_write_begin_int+0x10/0x10 [ 76.101678][ T5357] cont_write_begin+0x789/0xb50 [ 76.101689][ T5357] ? __pfx_cont_write_begin+0x10/0x10 [ 76.101699][ T5357] ? __pfx___might_resched+0x10/0x10 [ 76.101708][ T5357] ? folio_unlock+0x101/0x160 [ 76.101724][ T5357] hfsplus_write_begin+0x66/0xb0 [ 76.101734][ T5357] ? __pfx_hfsplus_get_block+0x10/0x10 [ 76.101744][ T5357] generic_perform_write+0x2c5/0x900 [ 76.101758][ T5357] ? __pfx_generic_perform_write+0x10/0x10 [ 76.101768][ T5357] ? file_update_time+0x2da/0x490 [ 76.101780][ T5357] ? __generic_file_write_iter+0xf9/0x230 [ 76.101791][ T5357] ? generic_file_write_iter+0x103/0x550 [ 76.101804][ T5357] generic_file_write_iter+0x117/0x550 [ 76.101815][ T5357] ? __pfx_generic_file_write_iter+0x10/0x10 [ 76.101828][ T5357] ? lockdep_hardirqs_on+0x9c/0x150 [ 76.101842][ T5357] ? _raw_spin_unlock_irqrestore+0xad/0x110 [ 76.101856][ T5357] ? __pfx_aa_file_perm+0x10/0x10 [ 76.101875][ T5357] ? __lock_acquire+0xab9/0xd20 [ 76.101894][ T5357] ? aio_write+0x4c4/0x7a0 [ 76.101912][ T5357] aio_write+0x532/0x7a0 [ 76.101936][ T5357] ? __pfx_aio_write+0x10/0x10 [ 76.101954][ T5357] ? __might_fault+0xb0/0x130 [ 76.101970][ T5357] io_submit_one+0x78b/0x1310 [ 76.101988][ T5357] ? __pfx_io_submit_one+0x10/0x10 [ 76.102003][ T5357] ? __might_fault+0xb0/0x130 [ 76.102016][ T5357] ? __might_fault+0xb0/0x130 [ 76.102028][ T5357] __se_sys_io_submit+0x185/0x2f0 [ 76.102043][ T5357] ? __pfx___se_sys_io_submit+0x10/0x10 [ 76.102060][ T5357] ? do_syscall_64+0xbe/0x3b0 [ 76.102075][ T5357] do_syscall_64+0xfa/0x3b0 [ 76.102088][ T5357] ? lockdep_hardirqs_on+0x9c/0x150 [ 76.102102][ T5357] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 76.102112][ T5357] ? clear_bhb_loop+0x60/0xb0 [ 76.102123][ T5357] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 76.102134][ T5357] RIP: 0033:0x7f8e2538ebe9 [ 76.102145][ T5357] Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 [ 76.102154][ T5357] RSP: 002b:00007f8e262d5038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 [ 76.102167][ T5357] RAX: ffffffffffffffda RBX: 00007f8e255b5fa0 RCX: 00007f8e2538ebe9 [ 76.102175][ T5357] RDX: 0000200000000540 RSI: 000000000000003b RDI: 00007f8e2628b000 [ 76.102183][ T5357] RBP: 00007f8e25411e19 R08: 0000000000000000 R09: 0000000000000000 [ 76.102190][ T5357] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 76.102197][ T5357] R13: 00007f8e255b6038 R14: 00007f8e255b5fa0 R15: 00007ffd673ce8b8 [ 76.102209][ T5357]