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(&(0x7f0000000000)='./file1\x00', 0x45) openat$cgroup_ro(r0, &(0x7f0000000100)='hugetlb.1GB.rsvd.usage_in_bytes\x00', 0x0, 0x0) r1 = geteuid() quotactl$Q_GETNEXTQUOTA(0xffffffff80000901, &(0x7f0000000140)=@sg0, r1, &(0x7f0000000180)) io_setup(0x202, &(0x7f0000000200)=0x0) io_submit(r2, 0x3b, &(0x7f0000000540)=[&(0x7f00000000c0)={0x25, 0xe7030000, 0x0, 0x1, 0x0, r0, &(0x7f0000000000), 0x70000}]) [ 69.255278][ T5300] Bluetooth: hci0: command tx timeout [ 69.337019][ T5314] loop0: detected capacity change from 0 to 1024 [ 69.380902][ T5314] [ 69.381864][ T5314] ============================================ [ 69.384258][ T5314] WARNING: possible recursive locking detected [ 69.386878][ T5314] 6.12.0-syzkaller-12128-gf788b5ef1ca9 #0 Not tainted [ 69.389415][ T5314] -------------------------------------------- [ 69.391765][ T5314] syz.0.0/5314 is trying to acquire lock: [ 69.393962][ T5314] ffff888043ba0108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 69.398194][ T5314] [ 69.398194][ T5314] but task is already holding lock: [ 69.400919][ T5314] ffff888043ba2988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 69.405091][ T5314] [ 69.405091][ T5314] other info that might help us debug this: [ 69.408085][ T5314] Possible unsafe locking scenario: [ 69.408085][ T5314] [ 69.410841][ T5314] CPU0 [ 69.412152][ T5314] ---- [ 69.413479][ T5314] lock(&HFSPLUS_I(inode)->extents_lock); [ 69.415683][ T5314] lock(&HFSPLUS_I(inode)->extents_lock); [ 69.418022][ T5314] [ 69.418022][ T5314] *** DEADLOCK *** [ 69.418022][ T5314] [ 69.421027][ T5314] May be due to missing lock nesting notation [ 69.421027][ T5314] [ 69.423987][ T5314] 3 locks held by syz.0.0/5314: [ 69.425717][ T5314] #0: ffff888043ba2b78 (&sb->s_type->i_mutex_key#19){+.+.}-{4:4}, at: generic_file_write_iter+0x82/0x310 [ 69.429942][ T5314] #1: ffff888043ba2988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 69.434115][ T5314] #2: ffff88801e04e0b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x14a/0x1c0 [ 69.437767][ T5314] [ 69.437767][ T5314] stack backtrace: [ 69.439961][ T5314] CPU: 0 UID: 0 PID: 5314 Comm: syz.0.0 Not tainted 6.12.0-syzkaller-12128-gf788b5ef1ca9 #0 [ 69.443755][ T5314] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 69.447636][ T5314] Call Trace: [ 69.448885][ T5314] [ 69.450044][ T5314] dump_stack_lvl+0x241/0x360 [ 69.451801][ T5314] ? __pfx_dump_stack_lvl+0x10/0x10 [ 69.453741][ T5314] ? __pfx__printk+0x10/0x10 [ 69.455448][ T5314] ? lockdep_unlock+0x16a/0x300 [ 69.457262][ T5314] print_deadlock_bug+0x483/0x620 [ 69.459116][ T5314] validate_chain+0x15e2/0x5920 [ 69.460985][ T5314] ? __bfs+0x368/0x6f0 [ 69.462525][ T5314] ? __pfx_hlock_conflict+0x10/0x10 [ 69.464417][ T5314] ? __pfx_validate_chain+0x10/0x10 [ 69.466447][ T5314] ? check_path+0x21/0x40 [ 69.468092][ T5314] ? check_noncircular+0x259/0x4a0 [ 69.470053][ T5314] ? look_up_lock_class+0x77/0x170 [ 69.471968][ T5314] ? register_lock_class+0x102/0x980 [ 69.473983][ T5314] ? lockdep_unlock+0x16a/0x300 [ 69.475753][ T5314] ? __pfx_register_lock_class+0x10/0x10 [ 69.477810][ T5314] ? mark_lock+0x9a/0x360 [ 69.479448][ T5314] __lock_acquire+0x1397/0x2100 [ 69.481305][ T5314] lock_acquire+0x1ed/0x550 [ 69.483011][ T5314] ? hfsplus_file_extend+0x21b/0x1b70 [ 69.485073][ T5314] ? __pfx_lock_acquire+0x10/0x10 [ 69.486908][ T5314] ? __pfx___might_resched+0x10/0x10 [ 69.489282][ T5314] __mutex_lock+0x1ac/0xee0 [ 69.491131][ T5314] ? hfsplus_file_extend+0x21b/0x1b70 [ 69.493097][ T5314] ? lockdep_hardirqs_on_prepare+0x43d/0x780 [ 69.495351][ T5314] ? mark_lock+0x9a/0x360 [ 69.496959][ T5314] ? hfsplus_file_extend+0x21b/0x1b70 [ 69.498893][ T5314] ? __pfx___mutex_lock+0x10/0x10 [ 69.500769][ T5314] hfsplus_file_extend+0x21b/0x1b70 [ 69.502666][ T5314] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 69.504662][ T5314] ? __pfx___mutex_trylock_common+0x10/0x10 [ 69.506895][ T5314] ? rcu_is_watching+0x15/0xb0 [ 69.508716][ T5314] ? trace_contention_end+0x3c/0x120 [ 69.510756][ T5314] ? __mutex_lock+0x37f/0xee0 [ 69.512566][ T5314] ? hfsplus_brec_find+0x19d/0x570 [ 69.514505][ T5314] hfsplus_bmap_reserve+0x105/0x4e0 [ 69.516428][ T5314] __hfsplus_ext_write_extent+0x2a4/0x5c0 [ 69.518546][ T5314] __hfsplus_ext_cache_extent+0x84/0xe10 [ 69.520593][ T5314] hfsplus_file_extend+0x48c/0x1b70 [ 69.522560][ T5314] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 69.524599][ T5314] ? clean_bdev_aliases+0x654/0x7e0 [ 69.526531][ T5314] ? __pfx_clean_bdev_aliases+0x10/0x10 [ 69.528584][ T5314] hfsplus_get_block+0x406/0x14f0 [ 69.530401][ T5314] ? __pfx_hfsplus_get_block+0x10/0x10 [ 69.532535][ T5314] ? create_empty_buffers+0x53e/0x740 [ 69.534484][ T5314] __block_write_begin_int+0x50c/0x1a70 [ 69.536535][ T5314] ? irqentry_exit+0x63/0x90 [ 69.538291][ T5314] ? __pfx_hfsplus_get_block+0x10/0x10 [ 69.540384][ T5314] ? __pfx___block_write_begin_int+0x10/0x10 [ 69.542745][ T5314] cont_write_begin+0x6e2/0x9d0 [ 69.544586][ T5314] ? __pfx_cont_write_begin+0x10/0x10 [ 69.546587][ T5314] ? __pfx_fault_in_readable+0x10/0x10 [ 69.548475][ T5314] ? __mark_inode_dirty+0x3db/0xe90 [ 69.550299][ T5314] hfsplus_write_begin+0x68/0xb0 [ 69.552031][ T5314] ? __pfx_hfsplus_get_block+0x10/0x10 [ 69.553946][ T5314] generic_perform_write+0x344/0x6d0 [ 69.555663][ T5314] ? __pfx_generic_perform_write+0x10/0x10 [ 69.557641][ T5314] ? file_update_time+0x2ab/0x450 [ 69.559408][ T5314] ? __generic_file_write_iter+0x102/0x230 [ 69.561556][ T5314] generic_file_write_iter+0xae/0x310 [ 69.563559][ T5314] aio_write+0x56b/0x7c0 [ 69.565123][ T5314] ? __pfx_aio_write+0x10/0x10 [ 69.566947][ T5314] ? __might_fault+0xaa/0x120 [ 69.568657][ T5314] ? __pfx_lock_release+0x10/0x10 [ 69.570553][ T5314] ? __fget_files+0x2a/0x410 [ 69.572234][ T5314] ? __might_fault+0xaa/0x120 [ 69.573938][ T5314] io_submit_one+0x8a7/0x18a0 [ 69.575647][ T5314] ? __pfx_io_submit_one+0x10/0x10 [ 69.577672][ T5314] ? __might_fault+0xaa/0x120 [ 69.579313][ T5314] ? __pfx_lock_release+0x10/0x10 [ 69.581196][ T5314] ? __might_fault+0xaa/0x120 [ 69.582897][ T5314] ? __might_fault+0xc6/0x120 [ 69.584647][ T5314] __se_sys_io_submit+0x171/0x2e0 [ 69.586550][ T5314] ? __pfx___se_sys_io_submit+0x10/0x10 [ 69.588787][ T5314] ? lockdep_hardirqs_on_prepare+0x43d/0x780 [ 69.591293][ T5314] ? do_syscall_64+0x100/0x230 [ 69.592789][ T5314] ? do_syscall_64+0xb6/0x230 [ 69.594492][ T5314] do_syscall_64+0xf3/0x230 [ 69.596154][ T5314] ? clear_bhb_loop+0x35/0x90 [ 69.597834][ T5314] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 69.599859][ T5314] RIP: 0033:0x7f168e980849 [ 69.601529][ T5314] 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 [ 69.608479][ T5314] RSP: 002b:00007f168f7a0058 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 [ 69.611734][ T5314] RAX: ffffffffffffffda RBX: 00007f168eb45fa0 RCX: 00007f168e980849 [ 69.614549][ T5314] RDX: 0000000020000540 RSI: 000000000000003b RDI: 00007f168f756000 [ 69.617415][ T5314] RBP: 00007f168e9f3986 R08: 0000000000000000 R09: 0000000000000000 [ 69.620221][ T5314] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 69.623162][ T5314] R13: 0000000000000000 R14: 00007f168eb45fa0 R15: 00007ffc067ab8e8 [ 69.626006][ T5314]