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)='./bus\x00', 0x0) io_setup(0x202, &(0x7f0000000200)=0x0) r2 = openat(0xffffffffffffff9c, &(0x7f0000000040)='./file2\x00', 0x143042, 0x0) pwritev2(r2, &(0x7f0000000100)=[{&(0x7f0000000080)="ff", 0xabfb}], 0x1, 0x5405, 0x0, 0x0) sendfile(r2, r2, 0x0, 0x7a680000) io_submit(r1, 0x3b, &(0x7f0000000540)=[&(0x7f00000000c0)={0x25, 0xe7030000, 0x0, 0x1, 0x0, r0, &(0x7f0000000000), 0x70000}]) [ 70.459058][ T5302] Bluetooth: hci0: command tx timeout [ 70.558024][ T5317] loop0: detected capacity change from 0 to 1024 [ 70.608697][ T5317] [ 70.609929][ T5317] ============================================ [ 70.613081][ T5317] WARNING: possible recursive locking detected [ 70.616278][ T5317] 6.13.0-rc1-syzkaller-00001-ge70140ba0d2b #0 Not tainted [ 70.619831][ T5317] -------------------------------------------- [ 70.622844][ T5317] syz.0.0/5317 is trying to acquire lock: [ 70.625614][ T5317] ffff888036948108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 70.630986][ T5317] [ 70.630986][ T5317] but task is already holding lock: [ 70.633912][ T5317] ffff88803694b048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 70.637853][ T5317] [ 70.637853][ T5317] other info that might help us debug this: [ 70.640977][ T5317] Possible unsafe locking scenario: [ 70.640977][ T5317] [ 70.643826][ T5317] CPU0 [ 70.645119][ T5317] ---- [ 70.646397][ T5317] lock(&HFSPLUS_I(inode)->extents_lock); [ 70.648592][ T5317] lock(&HFSPLUS_I(inode)->extents_lock); [ 70.650792][ T5317] [ 70.650792][ T5317] *** DEADLOCK *** [ 70.650792][ T5317] [ 70.653759][ T5317] May be due to missing lock nesting notation [ 70.653759][ T5317] [ 70.656713][ T5317] 4 locks held by syz.0.0/5317: [ 70.658475][ T5317] #0: ffff888044d64420 (sb_writers#11){.+.+}-{0:0}, at: vfs_writev+0x2d1/0xba0 [ 70.661843][ T5317] #1: ffff88803694b238 (&sb->s_type->i_mutex_key#19){+.+.}-{4:4}, at: generic_file_write_iter+0x82/0x310 [ 70.666044][ T5317] #2: ffff88803694b048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 [ 70.670052][ T5317] #3: ffff8880453de0b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x14a/0x1c0 [ 70.673492][ T5317] [ 70.673492][ T5317] stack backtrace: [ 70.675565][ T5317] CPU: 0 UID: 0 PID: 5317 Comm: syz.0.0 Not tainted 6.13.0-rc1-syzkaller-00001-ge70140ba0d2b #0 [ 70.679052][ T5317] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 70.682956][ T5317] Call Trace: [ 70.684313][ T5317] [ 70.685495][ T5317] dump_stack_lvl+0x241/0x360 [ 70.687407][ T5317] ? __pfx_dump_stack_lvl+0x10/0x10 [ 70.689454][ T5317] ? __pfx__printk+0x10/0x10 [ 70.691270][ T5317] ? lockdep_unlock+0x16a/0x300 [ 70.693197][ T5317] print_deadlock_bug+0x483/0x620 [ 70.695322][ T5317] validate_chain+0x15e2/0x5920 [ 70.697156][ T5317] ? unwind_get_return_address+0x4d/0x90 [ 70.699359][ T5317] ? arch_stack_walk+0xfd/0x150 [ 70.701298][ T5317] ? __pfx_validate_chain+0x10/0x10 [ 70.703375][ T5317] ? stack_trace_save+0x118/0x1d0 [ 70.705288][ T5317] ? __pfx_stack_trace_save+0x10/0x10 [ 70.707355][ T5317] ? check_noncircular+0x259/0x4a0 [ 70.709368][ T5317] ? look_up_lock_class+0x77/0x170 [ 70.711360][ T5317] ? register_lock_class+0x102/0x980 [ 70.713119][ T5317] ? lockdep_unlock+0x16a/0x300 [ 70.714663][ T5317] ? __pfx_register_lock_class+0x10/0x10 [ 70.716490][ T5317] ? mark_lock+0x9a/0x360 [ 70.718106][ T5317] __lock_acquire+0x1397/0x2100 [ 70.719753][ T5317] lock_acquire+0x1ed/0x550 [ 70.721512][ T5317] ? hfsplus_file_extend+0x21b/0x1b70 [ 70.723706][ T5317] ? __pfx_lock_acquire+0x10/0x10 [ 70.725595][ T5317] ? __pfx___might_resched+0x10/0x10 [ 70.727540][ T5317] __mutex_lock+0x1ac/0xee0 [ 70.729256][ T5317] ? hfsplus_file_extend+0x21b/0x1b70 [ 70.731454][ T5317] ? mark_lock+0x2ae/0x360 [ 70.733054][ T5317] ? hfsplus_file_extend+0x21b/0x1b70 [ 70.735009][ T5317] ? __pfx___mutex_lock+0x10/0x10 [ 70.736837][ T5317] hfsplus_file_extend+0x21b/0x1b70 [ 70.738876][ T5317] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 70.740784][ T5317] ? __pfx___mutex_trylock_common+0x10/0x10 [ 70.743096][ T5317] ? rcu_is_watching+0x15/0xb0 [ 70.744881][ T5317] ? trace_contention_end+0x3c/0x120 [ 70.746743][ T5317] ? __mutex_lock+0x37f/0xee0 [ 70.748280][ T5317] ? hfsplus_brec_find+0x19d/0x570 [ 70.749891][ T5317] hfsplus_bmap_reserve+0x105/0x4e0 [ 70.751646][ T5317] __hfsplus_ext_write_extent+0x2a4/0x5c0 [ 70.753580][ T5317] __hfsplus_ext_cache_extent+0x84/0xe10 [ 70.755640][ T5317] hfsplus_file_extend+0x48c/0x1b70 [ 70.757604][ T5317] ? __pfx_hfsplus_file_extend+0x10/0x10 [ 70.759755][ T5317] ? clean_bdev_aliases+0x654/0x7e0 [ 70.762022][ T5317] ? __pfx_clean_bdev_aliases+0x10/0x10 [ 70.764343][ T5317] hfsplus_get_block+0x406/0x14f0 [ 70.766428][ T5317] ? __pfx_hfsplus_get_block+0x10/0x10 [ 70.768470][ T5317] ? create_empty_buffers+0x53e/0x740 [ 70.770558][ T5317] __block_write_begin_int+0x50c/0x1a70 [ 70.772742][ T5317] ? irqentry_exit+0x63/0x90 [ 70.774575][ T5317] ? __pfx_hfsplus_get_block+0x10/0x10 [ 70.776702][ T5317] ? __pfx___block_write_begin_int+0x10/0x10 [ 70.779031][ T5317] cont_write_begin+0x6e2/0x9d0 [ 70.781055][ T5317] ? __pfx_cont_write_begin+0x10/0x10 [ 70.783397][ T5317] ? __pfx_fault_in_readable+0x10/0x10 [ 70.785534][ T5317] ? __mark_inode_dirty+0x3db/0xe90 [ 70.787745][ T5317] hfsplus_write_begin+0x68/0xb0 [ 70.789759][ T5317] ? __pfx_hfsplus_get_block+0x10/0x10 [ 70.792038][ T5317] generic_perform_write+0x344/0x6d0 [ 70.794036][ T5317] ? __pfx_generic_perform_write+0x10/0x10 [ 70.796204][ T5317] ? file_update_time+0x3dd/0x450 [ 70.798187][ T5317] ? __generic_file_write_iter+0x102/0x230 [ 70.800460][ T5317] generic_file_write_iter+0xae/0x310 [ 70.802522][ T5317] do_iter_readv_writev+0x600/0x880 [ 70.804645][ T5317] ? __pfx_do_iter_readv_writev+0x10/0x10 [ 70.806827][ T5317] ? rcu_read_lock_any_held+0xb7/0x160 [ 70.809176][ T5317] vfs_writev+0x376/0xba0 [ 70.810881][ T5317] ? __pfx_lock_acquire+0x10/0x10 [ 70.812829][ T5317] ? __pfx_vfs_writev+0x10/0x10 [ 70.815005][ T5317] ? do_sys_openat2+0x17a/0x1d0 [ 70.817100][ T5317] ? __might_fault+0xaa/0x120 [ 70.818934][ T5317] ? __fget_files+0x2a/0x410 [ 70.820668][ T5317] ? __fget_files+0x395/0x410 [ 70.822143][ T5317] ? __fget_files+0x2a/0x410 [ 70.823870][ T5317] __se_sys_pwritev2+0x196/0x2b0 [ 70.825474][ T5317] ? __pfx___se_sys_pwritev2+0x10/0x10 [ 70.827572][ T5317] ? do_syscall_64+0x100/0x230 [ 70.829278][ T5317] ? __x64_sys_pwritev2+0x21/0xf0 [ 70.831146][ T5317] do_syscall_64+0xf3/0x230 [ 70.832800][ T5317] ? clear_bhb_loop+0x35/0x90 [ 70.834545][ T5317] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 70.836775][ T5317] RIP: 0033:0x7feea897ff19 [ 70.838443][ T5317] 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 [ 70.845466][ T5317] RSP: 002b:00007feea977d058 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 [ 70.848401][ T5317] RAX: ffffffffffffffda RBX: 00007feea8b45fa0 RCX: 00007feea897ff19 [ 70.851444][ T5317] RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000005 [ 70.854020][ T5317] RBP: 00007feea89f3986 R08: 0000000000000000 R09: 0000000000000000 [ 70.856694][ T5317] R10: 0000000000005405 R11: 0000000000000246 R12: 0000000000000000 [ 70.859539][ T5317] R13: 0000000000000000 R14: 00007feea8b45fa0 R15: 00007fff8c032828 [ 70.862209][ T5317]