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', 0x40) r1 = socket$nl_xfrm(0x10, 0x3, 0x6) sendmsg$nl_xfrm(r1, &(0x7f0000000200)={0x0, 0x0, &(0x7f0000000000)={&(0x7f0000000640)=@updpolicy={0xc4, 0x19, 0xfd3649826d894c67, 0x0, 0x0, {{@in6=@mcast1, @in=@multicast1, 0x0, 0x0, 0x0, 0x0, 0xa}}, [@policy_type={0xa, 0x10, {0x1}}]}, 0xc4}}, 0x0) r2 = socket$nl_xfrm(0x10, 0x3, 0x6) sendmsg$nl_xfrm(r2, &(0x7f0000000000)={0x0, 0x0, &(0x7f00000001c0)={&(0x7f0000000040)=@updpolicy={0xb8, 0x19, 0xfd3649826d894c67, 0x0, 0x0, {{@in6=@dev, @in=@multicast1, 0x0, 0x0, 0x0, 0x0, 0xa}}}, 0xb8}}, 0x0) sendmsg$key(0xffffffffffffffff, &(0x7f0000000180)={0x0, 0x0, &(0x7f0000000140)={&(0x7f00000004c0)=ANY=[@ANYBLOB="021380ee02"], 0x10}}, 0x0) r3 = socket$key(0xf, 0x3, 0x2) sendmmsg(r3, &(0x7f0000000180), 0x32bc45944b084a6, 0x0) io_setup(0x202, &(0x7f0000000200)=0x0) io_submit(r4, 0x3b, &(0x7f0000000540)=[&(0x7f00000000c0)={0x25, 0xe7030000, 0x0, 0x1, 0x0, r0, &(0x7f0000000000), 0x70000}]) [ 58.199179][ T5311] loop0: detected capacity change from 0 to 1024 [ 58.258423][ T5311] [ 58.259366][ T5311] ============================================ [ 58.261725][ T5311] WARNING: possible recursive locking detected [ 58.264151][ T5311] 6.13.0-rc1-syzkaller-00001-ge70140ba0d2b #0 Not tainted [ 58.266724][ T5311] -------------------------------------------- [ 58.269064][ T5311] syz.0.0/5311 is trying to acquire lock: [ 58.271372][ T5311] ffff888052f7c108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 58.275734][ T5311] [ 58.275734][ T5311] but task is already holding lock: [ 58.278519][ T5311] ffff888052f7e988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 58.282739][ T5311] [ 58.282739][ T5311] other info that might help us debug this: [ 58.285797][ T5311] Possible unsafe locking scenario: [ 58.285797][ T5311] [ 58.288725][ T5311] CPU0 [ 58.289996][ T5311] ---- [ 58.291201][ T5311] lock(&HFSPLUS_I(inode)->extents_lock); [ 58.293457][ T5311] lock(&HFSPLUS_I(inode)->extents_lock); [ 58.295742][ T5311] [ 58.295742][ T5311] *** DEADLOCK *** [ 58.295742][ T5311] [ 58.298823][ T5311] May be due to missing lock nesting notation [ 58.298823][ T5311] [ 58.301765][ T5311] 3 locks held by syz.0.0/5311: [ 58.303579][ T5311] #0: ffff888052f7eb78 (&sb->s_type->i_mutex_key#19){+.+.}-{4:4}, at: generic_file_write_iter+0x82/0x310 [ 58.307626][ T5311] #1: ffff888052f7e988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 58.311738][ T5311] #2: ffff888043c900b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x14a/0x1c0 [ 58.315597][ T5311] [ 58.315597][ T5311] stack backtrace: [ 58.318298][ T5311] CPU: 0 UID: 0 PID: 5311 Comm: syz.0.0 Not tainted 6.13.0-rc1-syzkaller-00001-ge70140ba0d2b #0 [ 58.322038][ T5311] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 58.325555][ T5311] Call Trace: [ 58.326878][ T5311] [ 58.328123][ T5311] dump_stack_lvl+0x241/0x360 [ 58.329998][ T5311] ? __pfx_dump_stack_lvl+0x10/0x10 [ 58.331898][ T5311] ? __pfx__printk+0x10/0x10 [ 58.333527][ T5311] ? lockdep_unlock+0x16a/0x300 [ 58.335113][ T5311] print_deadlock_bug+0x483/0x620 [ 58.336928][ T5311] validate_chain+0x15e2/0x5920 [ 58.338846][ T5311] ? __bfs+0x368/0x6f0 [ 58.340421][ T5311] ? __pfx_hlock_conflict+0x10/0x10 [ 58.342472][ T5311] ? __pfx_validate_chain+0x10/0x10 [ 58.344386][ T5311] ? check_path+0x21/0x40 [ 58.345899][ T5311] ? check_noncircular+0x259/0x4a0 [ 58.347783][ T5311] ? look_up_lock_class+0x77/0x170 [ 58.349774][ T5311] ? register_lock_class+0x102/0x980 [ 58.351668][ T5311] ? lockdep_unlock+0x16a/0x300 [ 58.353671][ T5311] ? __pfx_register_lock_class+0x10/0x10 [ 58.355832][ T5311] ? mark_lock+0x9a/0x360 [ 58.357492][ T5311] __lock_acquire+0x1397/0x2100 [ 58.359306][ T5311] lock_acquire+0x1ed/0x550 [ 58.360977][ T5311] ? hfsplus_file_extend+0x21b/0x1b70 [ 58.363102][ T5311] ? __pfx_lock_acquire+0x10/0x10 [ 58.365022][ T5311] ? __pfx___might_resched+0x10/0x10 [ 58.366935][ T5311] __mutex_lock+0x1ac/0xee0 [ 58.368680][ T5311] ? hfsplus_file_extend+0x21b/0x1b70 [ 58.370622][ T5311] ? lockdep_hardirqs_on_prepare+0x43d/0x780 [ 58.372917][ T5311] ? mark_lock+0x9a/0x360 [ 58.374558][ T5311] ? hfsplus_file_extend+0x21b/0x1b70 [ 58.376691][ T5311] ? __pfx___mutex_lock+0x10/0x10 [ 58.378876][ T5311] hfsplus_file_extend+0x21b/0x1b70 [ 58.380741][ T5311] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 58.382650][ T5311] ? __pfx___mutex_trylock_common+0x10/0x10 [ 58.384854][ T5311] ? rcu_is_watching+0x15/0xb0 [ 58.386678][ T5311] ? trace_contention_end+0x3c/0x120 [ 58.388688][ T5311] ? __mutex_lock+0x37f/0xee0 [ 58.390519][ T5311] ? hfsplus_brec_find+0x19d/0x570 [ 58.392617][ T5311] hfsplus_bmap_reserve+0x105/0x4e0 [ 58.394759][ T5311] __hfsplus_ext_write_extent+0x2a4/0x5c0 [ 58.396980][ T5311] __hfsplus_ext_cache_extent+0x84/0xe10 [ 58.399098][ T5311] hfsplus_file_extend+0x48c/0x1b70 [ 58.401100][ T5311] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 58.403396][ T5311] ? clean_bdev_aliases+0x654/0x7e0 [ 58.405553][ T5311] ? __pfx_clean_bdev_aliases+0x10/0x10 [ 58.407597][ T5311] hfsplus_get_block+0x406/0x14f0 [ 58.409574][ T5311] ? __pfx_hfsplus_get_block+0x10/0x10 [ 58.411657][ T5311] ? create_empty_buffers+0x53e/0x740 [ 58.413723][ T5311] __block_write_begin_int+0x50c/0x1a70 [ 58.415813][ T5311] ? irqentry_exit+0x63/0x90 [ 58.417559][ T5311] ? __pfx_hfsplus_get_block+0x10/0x10 [ 58.419645][ T5311] ? __pfx___block_write_begin_int+0x10/0x10 [ 58.421796][ T5311] cont_write_begin+0x6e2/0x9d0 [ 58.423654][ T5311] ? __pfx_cont_write_begin+0x10/0x10 [ 58.425668][ T5311] ? __pfx_fault_in_readable+0x10/0x10 [ 58.427750][ T5311] ? __mark_inode_dirty+0x3db/0xe90 [ 58.429693][ T5311] hfsplus_write_begin+0x68/0xb0 [ 58.431471][ T5311] ? __pfx_hfsplus_get_block+0x10/0x10 [ 58.433625][ T5311] generic_perform_write+0x344/0x6d0 [ 58.435616][ T5311] ? __pfx_generic_perform_write+0x10/0x10 [ 58.437846][ T5311] ? file_update_time+0x2ab/0x450 [ 58.439755][ T5311] ? __generic_file_write_iter+0x102/0x230 [ 58.441946][ T5311] generic_file_write_iter+0xae/0x310 [ 58.444003][ T5311] aio_write+0x56b/0x7c0 [ 58.445575][ T5311] ? __pfx_aio_write+0x10/0x10 [ 58.447358][ T5311] ? __might_fault+0xaa/0x120 [ 58.449124][ T5311] ? __pfx_lock_release+0x10/0x10 [ 58.450870][ T5311] ? __fget_files+0x2a/0x410 [ 58.452517][ T5311] ? __might_fault+0xaa/0x120 [ 58.454187][ T5311] io_submit_one+0x8a7/0x18a0 [ 58.455841][ T5311] ? __pfx_io_submit_one+0x10/0x10 [ 58.457550][ T5311] ? __might_fault+0xaa/0x120 [ 58.459206][ T5311] ? __pfx_lock_release+0x10/0x10 [ 58.460935][ T5311] ? __might_fault+0xaa/0x120 [ 58.462582][ T5311] ? __might_fault+0xc6/0x120 [ 58.464239][ T5311] __se_sys_io_submit+0x171/0x2e0 [ 58.466073][ T5311] ? __pfx___se_sys_io_submit+0x10/0x10 [ 58.468122][ T5311] ? lockdep_hardirqs_on_prepare+0x43d/0x780 [ 58.470369][ T5311] ? do_syscall_64+0x100/0x230 [ 58.472290][ T5311] ? do_syscall_64+0xb6/0x230 [ 58.474090][ T5311] do_syscall_64+0xf3/0x230 [ 58.475752][ T5311] ? clear_bhb_loop+0x35/0x90 [ 58.477443][ T5311] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 58.479516][ T5311] RIP: 0033:0x7f357717ff19 [ 58.481131][ T5311] 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 [ 58.488338][ T5311] RSP: 002b:00007f3577f36058 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 [ 58.491425][ T5311] RAX: ffffffffffffffda RBX: 00007f3577345fa0 RCX: 00007f357717ff19 [ 58.494524][ T5311] RDX: 0000000020000540 RSI: 000000000000003b RDI: 00007f3577eec000 [ 58.497326][ T5311] RBP: 00007f35771f3986 R08: 0000000000000000 R09: 0000000000000000 [ 58.500020][ T5311] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 58.502963][ T5311] R13: 0000000000000000 R14: 00007f3577345fa0 R15: 00007ffc1f39d608 [ 58.505722][ T5311] [ 58.511328][ T4661] Bluetooth: hci0: command tx timeout