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}]) [ 74.798358][ T5331] Bluetooth: hci0: command tx timeout [ 74.880314][ T5352] loop0: detected capacity change from 0 to 1024 [ 74.966132][ T5352] [ 74.967194][ T5352] ============================================ [ 74.969868][ T5352] WARNING: possible recursive locking detected [ 74.972553][ T5352] 6.17.0-rc1-syzkaller-00036-gdfc0f6373094 #0 Not tainted [ 74.975524][ T5352] -------------------------------------------- [ 74.977881][ T5352] syz.0.0/5352 is trying to acquire lock: [ 74.980183][ T5352] ffff88805301c108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 74.985135][ T5352] [ 74.985135][ T5352] but task is already holding lock: [ 74.988400][ T5352] ffff88805301e988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 74.992909][ T5352] [ 74.992909][ T5352] other info that might help us debug this: [ 74.996445][ T5352] Possible unsafe locking scenario: [ 74.996445][ T5352] [ 74.999793][ T5352] CPU0 [ 75.001335][ T5352] ---- [ 75.002868][ T5352] lock(&HFSPLUS_I(inode)->extents_lock); [ 75.005491][ T5352] lock(&HFSPLUS_I(inode)->extents_lock); [ 75.008027][ T5352] [ 75.008027][ T5352] *** DEADLOCK *** [ 75.008027][ T5352] [ 75.011532][ T5352] May be due to missing lock nesting notation [ 75.011532][ T5352] [ 75.015105][ T5352] 3 locks held by syz.0.0/5352: [ 75.017412][ T5352] #0: ffff88805301eb78 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: generic_file_write_iter+0xeb/0x550 [ 75.022268][ T5352] #1: ffff88805301e988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1fc/0x1990 [ 75.027263][ T5352] #2: ffff88801174a0b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x15a/0x1d0 [ 75.032008][ T5352] [ 75.032008][ T5352] stack backtrace: [ 75.035050][ T5352] CPU: 0 UID: 0 PID: 5352 Comm: syz.0.0 Not tainted 6.17.0-rc1-syzkaller-00036-gdfc0f6373094 #0 PREEMPT(full) [ 75.035069][ T5352] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 75.035078][ T5352] Call Trace: [ 75.035085][ T5352] [ 75.035091][ T5352] dump_stack_lvl+0x189/0x250 [ 75.035111][ T5352] ? __pfx_dump_stack_lvl+0x10/0x10 [ 75.035124][ T5352] ? __pfx__printk+0x10/0x10 [ 75.035139][ T5352] ? print_lock_name+0xde/0x100 [ 75.035154][ T5352] print_deadlock_bug+0x28b/0x2a0 [ 75.035167][ T5352] validate_chain+0x1a3f/0x2140 [ 75.035178][ T5352] ? __bfs+0x154/0x2a0 [ 75.035188][ T5352] ? check_path+0x21/0x40 [ 75.035198][ T5352] ? look_up_lock_class+0x74/0x170 [ 75.035260][ T5352] ? register_lock_class+0x51/0x320 [ 75.035279][ T5352] __lock_acquire+0xab9/0xd20 [ 75.035297][ T5352] ? hfsplus_file_extend+0x1fc/0x1990 [ 75.035308][ T5352] lock_acquire+0x120/0x360 [ 75.035323][ T5352] ? hfsplus_file_extend+0x1fc/0x1990 [ 75.035336][ T5352] __mutex_lock+0x187/0x1360 [ 75.035352][ T5352] ? hfsplus_file_extend+0x1fc/0x1990 [ 75.035362][ T5352] ? check_path+0x21/0x40 [ 75.035371][ T5352] ? check_noncircular+0xe0/0x160 [ 75.035382][ T5352] ? hfsplus_file_extend+0x1fc/0x1990 [ 75.035392][ T5352] ? lockdep_unlock+0x89/0x120 [ 75.035407][ T5352] ? __pfx___mutex_lock+0x10/0x10 [ 75.035424][ T5352] hfsplus_file_extend+0x1fc/0x1990 [ 75.035435][ T5352] ? __lock_acquire+0xab9/0xd20 [ 75.035452][ T5352] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 75.035464][ T5352] ? __pfx___mutex_trylock_common+0x10/0x10 [ 75.035483][ T5352] ? __se_sys_io_submit+0x185/0x2f0 [ 75.035499][ T5352] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 75.035511][ T5352] ? rcu_is_watching+0x15/0xb0 [ 75.035523][ T5352] ? trace_contention_end+0x39/0x120 [ 75.035534][ T5352] ? __mutex_lock+0x335/0x1360 [ 75.035549][ T5352] ? hfsplus_brec_find+0x191/0x500 [ 75.035567][ T5352] hfsplus_bmap_reserve+0x122/0x500 [ 75.035583][ T5352] __hfsplus_ext_write_extent+0x28d/0x5b0 [ 75.035596][ T5352] __hfsplus_ext_cache_extent+0x89/0xe30 [ 75.035608][ T5352] hfsplus_file_extend+0x444/0x1990 [ 75.035621][ T5352] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 75.035633][ T5352] ? clean_bdev_aliases+0x5c9/0x6b0 [ 75.035650][ T5352] ? __pfx_clean_bdev_aliases+0x10/0x10 [ 75.035668][ T5352] hfsplus_get_block+0x411/0x1530 [ 75.035682][ T5352] ? __pfx_hfsplus_get_block+0x10/0x10 [ 75.035693][ T5352] ? do_raw_spin_unlock+0x4d/0x240 [ 75.035706][ T5352] ? _raw_spin_unlock+0x28/0x50 [ 75.035719][ T5352] __block_write_begin_int+0x6b2/0x1900 [ 75.035732][ T5352] ? folio_add_lru+0x1b2/0x3d0 [ 75.035746][ T5352] ? __pfx_hfsplus_get_block+0x10/0x10 [ 75.035758][ T5352] ? __pfx___block_write_begin_int+0x10/0x10 [ 75.035769][ T5352] cont_write_begin+0x789/0xb50 [ 75.035781][ T5352] ? __pfx_cont_write_begin+0x10/0x10 [ 75.035790][ T5352] ? __pfx___might_resched+0x10/0x10 [ 75.035800][ T5352] ? folio_unlock+0x101/0x160 [ 75.035815][ T5352] hfsplus_write_begin+0x66/0xb0 [ 75.035824][ T5352] ? __pfx_hfsplus_get_block+0x10/0x10 [ 75.035835][ T5352] generic_perform_write+0x2c5/0x900 [ 75.035849][ T5352] ? __pfx_generic_perform_write+0x10/0x10 [ 75.035860][ T5352] ? file_update_time+0x416/0x490 [ 75.035871][ T5352] ? __generic_file_write_iter+0xf9/0x230 [ 75.035880][ T5352] ? generic_file_write_iter+0x103/0x550 [ 75.035892][ T5352] generic_file_write_iter+0x117/0x550 [ 75.035902][ T5352] ? __pfx_generic_file_write_iter+0x10/0x10 [ 75.035913][ T5352] ? lockdep_hardirqs_on+0x9c/0x150 [ 75.035926][ T5352] ? _raw_spin_unlock_irqrestore+0xad/0x110 [ 75.035940][ T5352] ? __pfx_aa_file_perm+0x10/0x10 [ 75.035957][ T5352] ? __lock_acquire+0xab9/0xd20 [ 75.035975][ T5352] ? aio_write+0x4c4/0x7a0 [ 75.035989][ T5352] aio_write+0x532/0x7a0 [ 75.036004][ T5352] ? __pfx_aio_write+0x10/0x10 [ 75.036033][ T5352] ? __might_fault+0xb0/0x130 [ 75.036052][ T5352] io_submit_one+0x78b/0x1310 [ 75.036070][ T5352] ? __pfx_io_submit_one+0x10/0x10 [ 75.036084][ T5352] ? __might_fault+0xb0/0x130 [ 75.036099][ T5352] ? __might_fault+0xb0/0x130 [ 75.036112][ T5352] __se_sys_io_submit+0x185/0x2f0 [ 75.036126][ T5352] ? __pfx___se_sys_io_submit+0x10/0x10 [ 75.036142][ T5352] ? do_syscall_64+0xbe/0x3b0 [ 75.036158][ T5352] do_syscall_64+0xfa/0x3b0 [ 75.036171][ T5352] ? lockdep_hardirqs_on+0x9c/0x150 [ 75.036182][ T5352] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 75.036192][ T5352] ? clear_bhb_loop+0x60/0xb0 [ 75.036204][ T5352] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 75.036216][ T5352] RIP: 0033:0x7fb8e978ebe9 [ 75.036227][ T5352] 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 [ 75.036237][ T5352] RSP: 002b:00007fb8ea644038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 [ 75.036250][ T5352] RAX: ffffffffffffffda RBX: 00007fb8e99b5fa0 RCX: 00007fb8e978ebe9 [ 75.036259][ T5352] RDX: 0000200000000540 RSI: 000000000000003b RDI: 00007fb8ea5fa000 [ 75.036266][ T5352] RBP: 00007fb8e9811e19 R08: 0000000000000000 R09: 0000000000000000 [ 75.036273][ T5352] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 75.036280][ T5352] R13: 00007fb8e99b6038 R14: 00007fb8e99b5fa0 R15: 00007ffdd1f3ddf8 [ 75.036292][ T5352]