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', 0x82) io_setup(0x202, &(0x7f0000000200)=0x0) r2 = socket$nl_netfilter(0x10, 0x3, 0xc) sendmsg$NFT_BATCH(r2, &(0x7f00000000c0)={0x0, 0x0, &(0x7f0000000040)={&(0x7f0000000500)={{0x14}, [@NFT_MSG_NEWTABLE={0x20, 0x0, 0xa, 0x301, 0x0, 0x0, {0x1}, [@NFTA_TABLE_NAME={0x9, 0x1, 'syz0\x00'}]}, @NFT_MSG_NEWCHAIN={0x40, 0x3, 0xa, 0x201, 0x0, 0x0, {0x1}, [@NFTA_CHAIN_NAME={0x9, 0x3, 'syz2\x00'}, @NFTA_CHAIN_HOOK={0x14, 0x4, 0x0, 0x1, [@NFTA_HOOK_PRIORITY={0x8}, @NFTA_HOOK_HOOKNUM={0x8}]}, @NFTA_CHAIN_TABLE={0x9, 0x1, 'syz0\x00'}]}], {0x14}}, 0x88}}, 0x0) r3 = socket$nl_netfilter(0x10, 0x3, 0xc) sendmsg$NFT_BATCH(r3, &(0x7f0000000080)={0x0, 0x0, &(0x7f0000000040)={&(0x7f00000004c0)=ANY=[@ANYBLOB="140000001000010000000000000000005f00000a50000000060a0b040000000000000000010000012400048020000180070001006374000014000280080002400000001708000140000000020900010073797a30000000000900020073797a32000000001400000011"], 0x78}, 0x1, 0x0, 0x0, 0x1}, 0x0) syz_emit_ethernet(0x46, &(0x7f0000000340)={@local, @link_local, @void, {@ipv6={0x86dd, @icmpv6={0x0, 0x6, "cb763e", 0x10, 0x3a, 0xff, @private1={0xfc, 0x1, '\x00', 0x1}, @ipv4={'\x00', '\xff\xff', @remote}, {[], @ndisc_ra}}}}}, 0x0) getpeername$packet(r0, &(0x7f0000000000)={0x11, 0x0, 0x0, 0x1, 0x0, 0x6, @dev}, &(0x7f0000000140)=0x14) msync(&(0x7f0000ff9000/0x4000)=nil, 0x4000, 0x1) ioctl$sock_inet6_SIOCADDRT(r0, 0x890b, &(0x7f0000000180)={@dev={0xfe, 0x80, '\x00', 0x25}, @private2={0xfc, 0x2, '\x00', 0x1}, @private0, 0x9, 0x6, 0x100, 0x600, 0x0, 0x40010054, r4}) io_submit(r1, 0x3b, &(0x7f0000000540)=[&(0x7f00000000c0)={0x25, 0xe7030000, 0x0, 0x1, 0x0, r0, &(0x7f0000000000), 0x70000}]) [ 86.499102][ T5338] Bluetooth: hci0: command tx timeout [ 86.596667][ T5363] loop0: detected capacity change from 0 to 1024 [ 86.705460][ T5363] [ 86.706637][ T5363] ============================================ [ 86.709397][ T5363] WARNING: possible recursive locking detected [ 86.712170][ T5363] syzkaller #0 Not tainted [ 86.714240][ T5363] -------------------------------------------- [ 86.717022][ T5363] syz.0.0/5363 is trying to acquire lock: [ 86.719632][ T5363] ffff888052aa0108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 86.725227][ T5363] [ 86.725227][ T5363] but task is already holding lock: [ 86.728594][ T5363] ffff888052aa2988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 86.733384][ T5363] [ 86.733384][ T5363] other info that might help us debug this: [ 86.736896][ T5363] Possible unsafe locking scenario: [ 86.736896][ T5363] [ 86.740121][ T5363] CPU0 [ 86.741635][ T5363] ---- [ 86.743412][ T5363] lock(&HFSPLUS_I(inode)->extents_lock); [ 86.746736][ T5363] lock(&HFSPLUS_I(inode)->extents_lock); [ 86.749535][ T5363] [ 86.749535][ T5363] *** DEADLOCK *** [ 86.749535][ T5363] [ 86.753230][ T5363] May be due to missing lock nesting notation [ 86.753230][ T5363] [ 86.756884][ T5363] 3 locks held by syz.0.0/5363: [ 86.759006][ T5363] #0: ffff888052aa2b78 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: generic_file_write_iter+0xeb/0x550 [ 86.763902][ T5363] #1: ffff888052aa2988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 86.769717][ T5363] #2: ffff888041d360b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x15a/0x1d0 [ 86.774175][ T5363] [ 86.774175][ T5363] stack backtrace: [ 86.776860][ T5363] CPU: 0 UID: 0 PID: 5363 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 86.776879][ T5363] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 86.776888][ T5363] Call Trace: [ 86.776895][ T5363] [ 86.776903][ T5363] dump_stack_lvl+0x189/0x250 [ 86.776926][ T5363] ? __pfx_dump_stack_lvl+0x10/0x10 [ 86.776941][ T5363] ? __pfx__printk+0x10/0x10 [ 86.776965][ T5363] ? print_lock_name+0xde/0x100 [ 86.776983][ T5363] print_deadlock_bug+0x28b/0x2a0 [ 86.776999][ T5363] validate_chain+0x1a3f/0x2140 [ 86.777012][ T5363] ? __bfs+0x151/0x2a0 [ 86.777023][ T5363] ? check_path+0x21/0x40 [ 86.777034][ T5363] ? look_up_lock_class+0x74/0x170 [ 86.777092][ T5363] ? register_lock_class+0x51/0x320 [ 86.777112][ T5363] __lock_acquire+0xab9/0xd20 [ 86.777132][ T5363] ? hfsplus_file_extend+0x1fc/0x1990 [ 86.777146][ T5363] lock_acquire+0x120/0x360 [ 86.777164][ T5363] ? hfsplus_file_extend+0x1fc/0x1990 [ 86.777181][ T5363] __mutex_lock+0x187/0x1350 [ 86.777198][ T5363] ? hfsplus_file_extend+0x1fc/0x1990 [ 86.777211][ T5363] ? check_path+0x21/0x40 [ 86.777223][ T5363] ? check_noncircular+0xe0/0x160 [ 86.777237][ T5363] ? hfsplus_file_extend+0x1fc/0x1990 [ 86.777249][ T5363] ? lockdep_unlock+0x89/0x120 [ 86.777266][ T5363] ? __pfx___mutex_lock+0x10/0x10 [ 86.777287][ T5363] hfsplus_file_extend+0x1fc/0x1990 [ 86.777299][ T5363] ? __lock_acquire+0xab9/0xd20 [ 86.777319][ T5363] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 86.777333][ T5363] ? __pfx___mutex_trylock_common+0x10/0x10 [ 86.777346][ T5363] ? __se_sys_io_submit+0x185/0x2f0 [ 86.777360][ T5363] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.777371][ T5363] ? rcu_is_watching+0x15/0xb0 [ 86.777382][ T5363] ? trace_contention_end+0x39/0x120 [ 86.777393][ T5363] ? __mutex_lock+0x335/0x1350 [ 86.777407][ T5363] ? hfsplus_brec_find+0x191/0x500 [ 86.777422][ T5363] hfsplus_bmap_reserve+0x122/0x500 [ 86.777438][ T5363] __hfsplus_ext_write_extent+0x28d/0x5b0 [ 86.777451][ T5363] __hfsplus_ext_cache_extent+0x89/0xe30 [ 86.777464][ T5363] hfsplus_file_extend+0x444/0x1990 [ 86.777478][ T5363] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 86.777491][ T5363] ? clean_bdev_aliases+0x5c9/0x6b0 [ 86.777510][ T5363] ? __pfx_clean_bdev_aliases+0x10/0x10 [ 86.777528][ T5363] hfsplus_get_block+0x411/0x1530 [ 86.777542][ T5363] ? __pfx_hfsplus_get_block+0x10/0x10 [ 86.777553][ T5363] ? do_raw_spin_unlock+0x4d/0x240 [ 86.777567][ T5363] ? _raw_spin_unlock+0x28/0x50 [ 86.777581][ T5363] __block_write_begin_int+0x6b2/0x1900 [ 86.777595][ T5363] ? folio_add_lru+0x1b2/0x3d0 [ 86.777612][ T5363] ? __pfx_hfsplus_get_block+0x10/0x10 [ 86.777624][ T5363] ? __pfx___block_write_begin_int+0x10/0x10 [ 86.777638][ T5363] cont_write_begin+0x789/0xb50 [ 86.777652][ T5363] ? __pfx_cont_write_begin+0x10/0x10 [ 86.777662][ T5363] ? __pfx___might_resched+0x10/0x10 [ 86.777673][ T5363] ? __mark_inode_dirty+0x3d2/0xe10 [ 86.777690][ T5363] ? folio_unlock+0x101/0x160 [ 86.777705][ T5363] hfsplus_write_begin+0x66/0xb0 [ 86.777716][ T5363] ? __pfx_hfsplus_get_block+0x10/0x10 [ 86.777727][ T5363] generic_perform_write+0x2c2/0x900 [ 86.777740][ T5363] ? __pfx_generic_perform_write+0x10/0x10 [ 86.777750][ T5363] ? file_update_time+0x2da/0x490 [ 86.777767][ T5363] ? __generic_file_write_iter+0xf9/0x230 [ 86.777777][ T5363] ? generic_file_write_iter+0x103/0x550 [ 86.777787][ T5363] generic_file_write_iter+0x117/0x550 [ 86.777799][ T5363] ? __pfx_generic_file_write_iter+0x10/0x10 [ 86.777810][ T5363] ? lockdep_hardirqs_on+0x9c/0x150 [ 86.777823][ T5363] ? _raw_spin_unlock_irqrestore+0xad/0x110 [ 86.777835][ T5363] ? __pfx_aa_file_perm+0x10/0x10 [ 86.777853][ T5363] ? __lock_acquire+0xab9/0xd20 [ 86.777872][ T5363] ? aio_write+0x4c4/0x7a0 [ 86.777887][ T5363] aio_write+0x532/0x7a0 [ 86.777902][ T5363] ? __pfx_aio_write+0x10/0x10 [ 86.777917][ T5363] ? __might_fault+0xb0/0x130 [ 86.777935][ T5363] io_submit_one+0x78b/0x1310 [ 86.777964][ T5363] ? __pfx_io_submit_one+0x10/0x10 [ 86.777981][ T5363] ? __might_fault+0xb0/0x130 [ 86.777997][ T5363] ? __might_fault+0xb0/0x130 [ 86.778011][ T5363] __se_sys_io_submit+0x185/0x2f0 [ 86.778025][ T5363] ? __pfx___se_sys_io_submit+0x10/0x10 [ 86.778041][ T5363] ? do_syscall_64+0xbe/0x3b0 [ 86.778057][ T5363] do_syscall_64+0xfa/0x3b0 [ 86.778069][ T5363] ? lockdep_hardirqs_on+0x9c/0x150 [ 86.778084][ T5363] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.778094][ T5363] ? clear_bhb_loop+0x60/0xb0 [ 86.778105][ T5363] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 86.778115][ T5363] RIP: 0033:0x7f1e0eb8ebe9 [ 86.778128][ T5363] 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 [ 86.778138][ T5363] RSP: 002b:00007f1e0f974038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 [ 86.778151][ T5363] RAX: ffffffffffffffda RBX: 00007f1e0edb5fa0 RCX: 00007f1e0eb8ebe9 [ 86.778160][ T5363] RDX: 0000200000000540 RSI: 000000000000003b RDI: 00007f1e0f92a000 [ 86.778168][ T5363] RBP: 00007f1e0ec11e19 R08: 0000000000000000 R09: 0000000000000000 [ 86.778176][ T5363] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 86.778184][ T5363] R13: 00007f1e0edb6038 R14: 00007f1e0edb5fa0 R15: 00007fff50763748 [ 86.778197][ T5363]