program: bpf$MAP_CREATE(0x0, &(0x7f00000000c0)=@base={0x1c, 0x3ff, 0x6d, 0x401, 0x201, 0x1, 0x40, '\x00', 0x0, 0xffffffffffffffff, 0x5, 0x2}, 0x48) r0 = syz_mount_image$hfsplus(&(0x7f0000000600), &(0x7f0000000040)='./file1\x00', 0x0, &(0x7f0000000080)={[{@part={'part', 0x3d, 0x40}}, {@nodecompose}, {@part={'part', 0x3d, 0x7}}, {@part={'part', 0x3d, 0xc}}, {@uid}, {@barrier}, {@nls={'nls', 0x3d, 'macinuit'}}, {@gid={'gid', 0x3d, 0xee00}}]}, 0x3, 0x5f4, &(0x7f0000000640)="$eJzs3c9rHOcZB/DvrNay5YKzSewkLS0V9qElprZWmzg6FOqWUnQIJdBLLjkIex0Lr5UgbYoSSpH789r/IClFPvfUQ+nBkJ577VHQQw6F3nVzmdlZaW0rshQr2lXy+cC77zv7zrzzzOOZVzuzmA3wtbX4dk49SJHFy2+ul8tbm53e1mbn7rCd5HSSRtIcVClWkuLT5HoGJd8s36yHKz5vP+98/MbCZ+3795KiORirOVy/sd92B7NRl8wmmarroxrvxjOPV+wcYZmwS8PEwbg9fMLGYTZ/xusWmGSt5GySM/XngNSzQ2PMYT2zQ81yAAAAcEI9t53trOfcuOMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAk6RIpgZVVRrD9myK4e//T9fvpW6faA/GHQAAAAAAAAAAHIHvbmc76zk3XH5YVN/5X6wWzlev38gHWUs3q7mS9Syln35W007SGhloen2p319tP3XLItl4NITBlvPHcLAAAAAAAAAA8NX1myzufv8PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACToEimBlVVzg/brTSaSc4kmS7X20j+MWyfZA/GHQAAAAAcg+e2s531nBsuPyyqe/6Xqvv+M/kgK+lnOf300s3N6lnA4K6/sbXZ6W1tdu6W5clxf/y/Q4VRjZjBs4e99zxXrXFhZ4vF/Cy/yOXM5q2sZjm/zF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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOBkW3w7px6kSHvuyly5vLXZ6ZVl2N5ds5mkkaT4VVJ8mlzPoKQ1Mlzxeft55+M3Fj5r37+3O1ZzuH5jv+0OZqMumU0yVddHNd6NZx6v2DnCMmGXhomDcft/AAAA//9Shwfb") r1 = openat$dir(0xffffffffffffff9c, &(0x7f0000000300)='.\x00', 0x2000, 0x12) getdents64(r1, &(0x7f0000000100)=""/154, 0x9a) unlinkat(0xffffffffffffff9c, &(0x7f00000003c0)='./file2\x00', 0x0) fspick(r0, &(0x7f00000001c0)='./file1\x00', 0x1) unlink(&(0x7f0000000000)='./file1\x00') [ 84.953190][ T4701] Bluetooth: hci0: command tx timeout [ 85.042572][ T5358] loop0: detected capacity change from 0 to 1024 [ 85.142950][ T5358] hfsplus: invalid extended attribute record [ 85.145940][ T5358] [ 85.147079][ T5358] ============================================ [ 85.149655][ T5358] WARNING: possible recursive locking detected [ 85.152280][ T5358] 6.16.0-syzkaller-12016-gbec077162bd0 #0 Not tainted [ 85.155140][ T5358] -------------------------------------------- [ 85.157986][ T5358] syz.0.0/5358 is trying to acquire lock: [ 85.160388][ T5358] ffff888052f31548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_get_block+0x39e/0x1530 [ 85.165011][ T5358] [ 85.165011][ T5358] but task is already holding lock: [ 85.168058][ T5358] ffff888052f33048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_truncate+0x294/0xb40 [ 85.172934][ T5358] [ 85.172934][ T5358] other info that might help us debug this: [ 85.176424][ T5358] Possible unsafe locking scenario: [ 85.176424][ T5358] [ 85.179564][ T5358] CPU0 [ 85.181006][ T5358] ---- [ 85.182528][ T5358] lock(&HFSPLUS_I(inode)->extents_lock); [ 85.184987][ T5358] lock(&HFSPLUS_I(inode)->extents_lock); [ 85.187775][ T5358] [ 85.187775][ T5358] *** DEADLOCK *** [ 85.187775][ T5358] [ 85.190969][ T5358] May be due to missing lock nesting notation [ 85.190969][ T5358] [ 85.194813][ T5358] 6 locks held by syz.0.0/5358: [ 85.197063][ T5358] #0: ffff888040776428 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 [ 85.200961][ T5358] #1: ffff888052f31df8 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: do_unlinkat+0x1c7/0x560 [ 85.205148][ T5358] #2: ffff888052f33238 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: vfs_unlink+0xf2/0x650 [ 85.209372][ T5358] #3: ffff888052f21198 (&sbi->vh_mutex){+.+.}-{4:4}, at: hfsplus_unlink+0x160/0x730 [ 85.213464][ T5358] #4: ffff888052f33048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_truncate+0x294/0xb40 [ 85.218154][ T5358] #5: ffff888052f210f8 (&sbi->alloc_mutex){+.+.}-{4:4}, at: hfsplus_block_free+0xbe/0x550 [ 85.221919][ T5358] [ 85.221919][ T5358] stack backtrace: [ 85.224447][ T5358] CPU: 0 UID: 0 PID: 5358 Comm: syz.0.0 Not tainted 6.16.0-syzkaller-12016-gbec077162bd0 #0 PREEMPT(full) [ 85.224465][ T5358] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 85.224472][ T5358] Call Trace: [ 85.224480][ T5358] [ 85.224488][ T5358] dump_stack_lvl+0x189/0x250 [ 85.224507][ T5358] ? __pfx_dump_stack_lvl+0x10/0x10 [ 85.224518][ T5358] ? __pfx__printk+0x10/0x10 [ 85.224533][ T5358] ? print_lock_name+0xde/0x100 [ 85.224545][ T5358] print_deadlock_bug+0x28b/0x2a0 [ 85.224555][ T5358] validate_chain+0x1a3f/0x2140 [ 85.224565][ T5358] ? lock_release+0x4b/0x3e0 [ 85.224580][ T5358] ? look_up_lock_class+0x74/0x170 [ 85.224636][ T5358] ? register_lock_class+0x51/0x320 [ 85.224651][ T5358] __lock_acquire+0xab9/0xd20 [ 85.224666][ T5358] ? hfsplus_get_block+0x39e/0x1530 [ 85.224677][ T5358] lock_acquire+0x120/0x360 [ 85.224691][ T5358] ? hfsplus_get_block+0x39e/0x1530 [ 85.224700][ T5358] ? stack_trace_save+0x9c/0xe0 [ 85.224712][ T5358] ? __pfx_hlock_conflict+0x10/0x10 [ 85.224723][ T5358] __mutex_lock+0x187/0x1360 [ 85.224736][ T5358] ? hfsplus_get_block+0x39e/0x1530 [ 85.224746][ T5358] ? lockdep_unlock+0x89/0x120 [ 85.224760][ T5358] ? hfsplus_get_block+0x39e/0x1530 [ 85.224771][ T5358] ? __pfx___mutex_lock+0x10/0x10 [ 85.224787][ T5358] hfsplus_get_block+0x39e/0x1530 [ 85.224797][ T5358] ? __pfx_hfsplus_get_block+0x10/0x10 [ 85.224806][ T5358] ? do_raw_spin_unlock+0x4d/0x240 [ 85.224816][ T5358] ? _raw_spin_unlock+0x28/0x50 [ 85.224827][ T5358] block_read_full_folio+0x29f/0x830 [ 85.224838][ T5358] ? __pfx_hfsplus_get_block+0x10/0x10 [ 85.224847][ T5358] filemap_read_folio+0x117/0x380 [ 85.224864][ T5358] ? __pfx_hfsplus_read_folio+0x10/0x10 [ 85.224878][ T5358] ? __pfx_filemap_read_folio+0x10/0x10 [ 85.224892][ T5358] ? filemap_add_folio+0x1af/0x270 [ 85.224905][ T5358] do_read_cache_folio+0x350/0x590 [ 85.224915][ T5358] ? __pfx_hfsplus_read_folio+0x10/0x10 [ 85.224929][ T5358] read_cache_page+0x5d/0x170 [ 85.224938][ T5358] hfsplus_block_free+0x121/0x550 [ 85.224953][ T5358] hfsplus_free_extents+0x10d/0xa60 [ 85.224965][ T5358] hfsplus_file_truncate+0x736/0xb40 [ 85.224978][ T5358] ? __pfx_hfsplus_file_truncate+0x10/0x10 [ 85.224988][ T5358] ? tomoyo_path_perm+0x1e3/0x4b0 [ 85.225000][ T5358] ? __pfx___mutex_lock+0x10/0x10 [ 85.225012][ T5358] ? __lock_acquire+0xab9/0xd20 [ 85.225027][ T5358] hfsplus_delete_inode+0x180/0x230 [ 85.225037][ T5358] hfsplus_unlink+0x4e3/0x730 [ 85.225048][ T5358] ? vfs_unlink+0xf2/0x650 [ 85.225061][ T5358] ? __pfx_hfsplus_unlink+0x10/0x10 [ 85.225072][ T5358] ? __pfx_down_write+0x10/0x10 [ 85.225085][ T5358] ? bpf_lsm_inode_unlink+0x9/0x20 [ 85.225100][ T5358] vfs_unlink+0x391/0x650 [ 85.225112][ T5358] do_unlinkat+0x345/0x560 [ 85.225158][ T5358] ? __pfx_do_unlinkat+0x10/0x10 [ 85.225173][ T5358] ? getname_flags+0x1e5/0x540 [ 85.225189][ T5358] __x64_sys_unlink+0x47/0x50 [ 85.225201][ T5358] do_syscall_64+0xfa/0x3b0 [ 85.225215][ T5358] ? lockdep_hardirqs_on+0x9c/0x150 [ 85.225225][ T5358] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.225234][ T5358] ? clear_bhb_loop+0x60/0xb0 [ 85.225246][ T5358] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 85.225256][ T5358] RIP: 0033:0x7f0ac0d8ebe9 [ 85.225267][ T5358] 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 [ 85.225276][ T5358] RSP: 002b:00007f0ac1b7f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 [ 85.225287][ T5358] RAX: ffffffffffffffda RBX: 00007f0ac0fb5fa0 RCX: 00007f0ac0d8ebe9 [ 85.225295][ T5358] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000000 [ 85.225303][ T5358] RBP: 00007f0ac0e11e19 R08: 0000000000000000 R09: 0000000000000000 [ 85.225309][ T5358] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 85.225316][ T5358] R13: 00007f0ac0fb6038 R14: 00007f0ac0fb5fa0 R15: 00007ffd0ff0a8e8 [ 85.225329][ T5358] [ 85.398648][ T5358] hfsplus: unable to mark blocks free: error -5 [ 85.401875][ T5358] hfsplus: can't free extent