====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.1501/11971 is trying to acquire lock: ffffffff8eb20570 (&subsys->su_mutex){+.+.}-{3:3}, at: configfs_rmdir+0x63c/0x980 fs/configfs/dir.c:1561 but task is already holding lock: ffff888076b0a9e0 (&sb->s_type->i_mutex_key#25){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline] ffff888076b0a9e0 (&sb->s_type->i_mutex_key#25){++++}-{3:3}, at: vfs_rmdir+0xee/0x4b0 fs/namei.c:4252 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sb->s_type->i_mutex_key#25){++++}-{3:3}: down_write+0x97/0x200 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:804 [inline] configfs_depend_item_unlocked+0x157/0x460 fs/configfs/dir.c:1260 usbg_make_tpg+0x1e1/0x550 drivers/usb/gadget/function/f_tcm.c:1347 target_fabric_make_tpg+0xa4/0x6d0 drivers/target/target_core_fabric_configfs.c:947 configfs_mkdir+0x515/0x9e0 fs/configfs/dir.c:1365 vfs_mkdir+0x2a5/0x470 fs/namei.c:4180 do_mkdirat+0x1dc/0x450 fs/namei.c:4203 __do_sys_mkdirat fs/namei.c:4218 [inline] __se_sys_mkdirat fs/namei.c:4216 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (tpg_instances_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xce0 kernel/locking/mutex.c:747 usbg_make_tpg+0xf9/0x550 drivers/usb/gadget/function/f_tcm.c:1324 target_fabric_make_tpg+0xa4/0x6d0 drivers/target/target_core_fabric_configfs.c:947 configfs_mkdir+0x515/0x9e0 fs/configfs/dir.c:1365 vfs_mkdir+0x2a5/0x470 fs/namei.c:4180 do_mkdirat+0x1dc/0x450 fs/namei.c:4203 __do_sys_mkdirat fs/namei.c:4218 [inline] __se_sys_mkdirat fs/namei.c:4216 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&subsys->su_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xce0 kernel/locking/mutex.c:747 configfs_rmdir+0x63c/0x980 fs/configfs/dir.c:1561 vfs_rmdir+0x352/0x4b0 fs/namei.c:4263 do_rmdir+0x29f/0x590 fs/namei.c:4322 __do_sys_rmdir fs/namei.c:4341 [inline] __se_sys_rmdir fs/namei.c:4339 [inline] __x64_sys_rmdir+0x49/0x50 fs/namei.c:4339 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &subsys->su_mutex --> tpg_instances_lock --> &sb->s_type->i_mutex_key#25 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#25); lock(tpg_instances_lock); lock(&sb->s_type->i_mutex_key#25); lock(&subsys->su_mutex); *** DEADLOCK *** 3 locks held by syz.0.1501/11971: #0: ffff888019718418 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412 #1: ffff888148f35fc0 (&default_group_class[depth - 1]#7/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline] #1: ffff888148f35fc0 (&default_group_class[depth - 1]#7/1){+.+.}-{3:3}, at: do_rmdir+0x1c6/0x590 fs/namei.c:4310 #2: ffff888076b0a9e0 (&sb->s_type->i_mutex_key#25){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline] #2: ffff888076b0a9e0 (&sb->s_type->i_mutex_key#25){++++}-{3:3}, at: vfs_rmdir+0xee/0x4b0 fs/namei.c:4252 stack backtrace: CPU: 0 PID: 11971 Comm: syz.0.1501 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215 check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xce0 kernel/locking/mutex.c:747 configfs_rmdir+0x63c/0x980 fs/configfs/dir.c:1561 vfs_rmdir+0x352/0x4b0 fs/namei.c:4263 do_rmdir+0x29f/0x590 fs/namei.c:4322 __do_sys_rmdir fs/namei.c:4341 [inline] __se_sys_rmdir fs/namei.c:4339 [inline] __x64_sys_rmdir+0x49/0x50 fs/namei.c:4339 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fd5cd79fb19 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd5ce61f028 EFLAGS: 00000246 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 00007fd5cda25fa0 RCX: 00007fd5cd79fb19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00002000000010c0 RBP: 00007fd5cd837af8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd5cda26038 R14: 00007fd5cda25fa0 R15: 00007fff38eb0a28