Warning: Permanently added '10.128.1.66' (ECDSA) to the list of known hosts. executing program [ 67.844664][ T3544] loop0: detected capacity change from 0 to 1024 [ 67.886956][ T3544] [ 67.889437][ T3544] ====================================================== [ 67.896652][ T3544] WARNING: possible circular locking dependency detected [ 67.903690][ T3544] 6.1.38-syzkaller #0 Not tainted [ 67.908744][ T3544] ------------------------------------------------------ [ 67.915936][ T3544] syz-executor297/3544 is trying to acquire lock: [ 67.922345][ T3544] ffff88807c9f60b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x80d/0xb40 [ 67.932203][ T3544] [ 67.932203][ T3544] but task is already holding lock: [ 67.939579][ T3544] ffff88807ddeb048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2d6/0xb40 [ 67.950741][ T3544] [ 67.950741][ T3544] which lock already depends on the new lock. [ 67.950741][ T3544] [ 67.961236][ T3544] [ 67.961236][ T3544] the existing dependency chain (in reverse order) is: [ 67.970251][ T3544] [ 67.970251][ T3544] -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: [ 67.979289][ T3544] lock_acquire+0x1f8/0x5a0 [ 67.984347][ T3544] __mutex_lock_common+0x1d4/0x2520 [ 67.990079][ T3544] mutex_lock_nested+0x17/0x20 [ 67.995476][ T3544] hfsplus_file_extend+0x1d2/0x1b10 [ 68.001209][ T3544] hfsplus_bmap_reserve+0x101/0x4e0 [ 68.006927][ T3544] hfsplus_rename_cat+0x1cf/0x1090 [ 68.012574][ T3544] hfsplus_unlink+0x304/0x7f0 [ 68.017909][ T3544] vfs_unlink+0x359/0x5f0 [ 68.022766][ T3544] do_unlinkat+0x49d/0x940 [ 68.027707][ T3544] __x64_sys_unlink+0x45/0x50 [ 68.032910][ T3544] do_syscall_64+0x3d/0xb0 [ 68.037848][ T3544] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 68.044262][ T3544] [ 68.044262][ T3544] -> #0 (&tree->tree_lock){+.+.}-{3:3}: [ 68.052036][ T3544] validate_chain+0x1667/0x58e0 [ 68.057434][ T3544] __lock_acquire+0x125b/0x1f80 [ 68.062800][ T3544] lock_acquire+0x1f8/0x5a0 [ 68.067924][ T3544] __mutex_lock_common+0x1d4/0x2520 [ 68.073829][ T3544] mutex_lock_nested+0x17/0x20 [ 68.079134][ T3544] hfsplus_file_truncate+0x80d/0xb40 [ 68.084952][ T3544] hfsplus_setattr+0x1b9/0x280 [ 68.090250][ T3544] notify_change+0xdcd/0x1080 [ 68.095445][ T3544] do_truncate+0x21c/0x300 [ 68.100383][ T3544] path_openat+0x27e2/0x2e60 [ 68.105505][ T3544] do_filp_open+0x230/0x480 [ 68.110526][ T3544] do_sys_openat2+0x13b/0x500 [ 68.115727][ T3544] __x64_sys_creat+0x11f/0x160 [ 68.121027][ T3544] do_syscall_64+0x3d/0xb0 [ 68.125976][ T3544] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 68.132388][ T3544] [ 68.132388][ T3544] other info that might help us debug this: [ 68.132388][ T3544] [ 68.142606][ T3544] Possible unsafe locking scenario: [ 68.142606][ T3544] [ 68.150048][ T3544] CPU0 CPU1 [ 68.155406][ T3544] ---- ---- [ 68.160760][ T3544] lock(&HFSPLUS_I(inode)->extents_lock); [ 68.166562][ T3544] lock(&tree->tree_lock); [ 68.173799][ T3544] lock(&HFSPLUS_I(inode)->extents_lock); [ 68.182128][ T3544] lock(&tree->tree_lock); [ 68.186645][ T3544] [ 68.186645][ T3544] *** DEADLOCK *** [ 68.186645][ T3544] [ 68.194817][ T3544] 3 locks held by syz-executor297/3544: [ 68.200456][ T3544] #0: ffff88807c9f4460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 [ 68.209716][ T3544] #1: ffff88807ddeb240 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: do_truncate+0x208/0x300 [ 68.220091][ T3544] #2: ffff88807ddeb048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2d6/0xb40 [ 68.231672][ T3544] [ 68.231672][ T3544] stack backtrace: [ 68.237574][ T3544] CPU: 1 PID: 3544 Comm: syz-executor297 Not tainted 6.1.38-syzkaller #0 [ 68.246012][ T3544] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 [ 68.256074][ T3544] Call Trace: [ 68.259371][ T3544] [ 68.262301][ T3544] dump_stack_lvl+0x1e3/0x2cb [ 68.267174][ T3544] ? nf_tcp_handle_invalid+0x642/0x642 [ 68.272655][ T3544] ? print_circular_bug+0x12b/0x1a0 [ 68.277862][ T3544] check_noncircular+0x2fa/0x3b0 [ 68.282810][ T3544] ? add_chain_block+0x850/0x850 [ 68.287762][ T3544] ? add_chain_block+0x850/0x850 [ 68.292706][ T3544] ? lockdep_lock+0x11f/0x2a0 [ 68.297602][ T3544] ? add_chain_block+0x850/0x850 [ 68.302554][ T3544] ? _find_first_zero_bit+0xd0/0x100 [ 68.307853][ T3544] validate_chain+0x1667/0x58e0 [ 68.312723][ T3544] ? reacquire_held_locks+0x660/0x660 [ 68.318104][ T3544] ? reacquire_held_locks+0x660/0x660 [ 68.323485][ T3544] ? look_up_lock_class+0x77/0x140 [ 68.328597][ T3544] ? register_lock_class+0x100/0x990 [ 68.333908][ T3544] ? mark_lock+0x9a/0x340 [ 68.338238][ T3544] ? is_dynamic_key+0x1f0/0x1f0 [ 68.343118][ T3544] ? __lock_acquire+0x125b/0x1f80 [ 68.348162][ T3544] ? mark_lock+0x9a/0x340 [ 68.352490][ T3544] __lock_acquire+0x125b/0x1f80 [ 68.357344][ T3544] lock_acquire+0x1f8/0x5a0 [ 68.361930][ T3544] ? hfsplus_file_truncate+0x80d/0xb40 [ 68.367497][ T3544] ? read_lock_is_recursive+0x10/0x10 [ 68.372870][ T3544] ? __might_sleep+0xb0/0xb0 [ 68.377465][ T3544] __mutex_lock_common+0x1d4/0x2520 [ 68.382747][ T3544] ? hfsplus_file_truncate+0x80d/0xb40 [ 68.388209][ T3544] ? hfsplus_file_truncate+0x80d/0xb40 [ 68.393668][ T3544] ? mutex_lock_io_nested+0x60/0x60 [ 68.398888][ T3544] ? hfsplus_free_extents+0x47e/0xae0 [ 68.404257][ T3544] mutex_lock_nested+0x17/0x20 [ 68.409038][ T3544] hfsplus_file_truncate+0x80d/0xb40 [ 68.414327][ T3544] ? hfsplus_add_extent+0x880/0x880 [ 68.419525][ T3544] ? unmap_mapping_range+0xf4/0x280 [ 68.424726][ T3544] ? unmap_mapping_pages+0x180/0x180 [ 68.430007][ T3544] ? current_time+0x1d1/0x2f0 [ 68.434689][ T3544] ? setattr_prepare+0x1e0/0xc20 [ 68.439622][ T3544] ? truncate_setsize+0xcb/0xf0 [ 68.444481][ T3544] hfsplus_setattr+0x1b9/0x280 [ 68.449252][ T3544] ? hfsplus_fileattr_set+0x330/0x330 [ 68.454633][ T3544] notify_change+0xdcd/0x1080 [ 68.459328][ T3544] do_truncate+0x21c/0x300 [ 68.463759][ T3544] ? put_page_bootmem+0x2e0/0x2e0 [ 68.468789][ T3544] ? ima_bprm_check+0x2b0/0x2b0 [ 68.473728][ T3544] ? bpf_lsm_path_truncate+0x5/0x10 [ 68.478944][ T3544] path_openat+0x27e2/0x2e60 [ 68.483559][ T3544] ? do_filp_open+0x480/0x480 [ 68.488268][ T3544] do_filp_open+0x230/0x480 [ 68.492774][ T3544] ? vfs_tmpfile+0x4a0/0x4a0 [ 68.497481][ T3544] ? _raw_spin_unlock+0x24/0x40 [ 68.502347][ T3544] ? alloc_fd+0x59c/0x640 [ 68.506682][ T3544] do_sys_openat2+0x13b/0x500 [ 68.511368][ T3544] ? do_sys_open+0x220/0x220 [ 68.515961][ T3544] ? do_unlinkat+0x87f/0x940 [ 68.520575][ T3544] ? lockdep_hardirqs_on_prepare+0x438/0x7a0 [ 68.526553][ T3544] __x64_sys_creat+0x11f/0x160 [ 68.531341][ T3544] ? __x64_compat_sys_openat+0x290/0x290 [ 68.537068][ T3544] ? syscall_enter_from_user_mode+0x2e/0x220 [ 68.543056][ T3544] ? lockdep_hardirqs_on+0x94/0x130 [ 68.548272][ T3544] ? syscall_enter_from_user_mode+0x2e/0x220 [ 68.554248][ T3544] do_syscall_64+0x3d/0xb0 [ 68.558671][ T3544] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 68.564574][ T3544] RIP: 0033:0x7f1289283879 [ 68.569013][ T3544] Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 00 00 90 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 c0 ff ff ff f7 d8 64 89 01 48 [ 68.588616][ T3544] RSP: 002b:00007fff71f2f978 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 [ 68.597026][ T3544] RAX: ffffffffffffffda RBX: 00007f12892c7060 RCX: 00007f1289283879 [ 68.605026][ T3544] RDX: 00007f1289283879 RSI: 0000000000000000 RDI: 0000000020000200 [ 68.613109][ T3544] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 [ 68.621162][ T3544] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000006161 [ 68.629594][ T3544] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 68.637572][ T3544]