====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc8-syzkaller-00148-g0d1409e4ff08 #0 Not tainted ------------------------------------------------------ syz-executor.0/4119 is trying to acquire lock: ffff888028e24130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline] ffff888028e24130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: rfcomm_sk_state_change+0x52/0x2f0 net/bluetooth/rfcomm/sock.c:73 but task is already holding lock: ffff88806fbefd28 (&d->lock){+.+.}-{3:3}, at: __rfcomm_dlc_close+0x276/0x470 net/bluetooth/rfcomm/core.c:487 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&d->lock){+.+.}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 __rfcomm_dlc_close+0x276/0x470 net/bluetooth/rfcomm/core.c:487 rfcomm_dlc_close+0x10d/0x1c0 net/bluetooth/rfcomm/core.c:520 __rfcomm_sock_close+0x101/0x220 net/bluetooth/rfcomm/sock.c:220 rfcomm_sock_shutdown+0xad/0x230 net/bluetooth/rfcomm/sock.c:907 rfcomm_sock_release+0x55/0x120 net/bluetooth/rfcomm/sock.c:928 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3ba/0x880 fs/file_table.c:320 task_work_run+0x243/0x300 kernel/task_work.c:179 get_signal+0x1642/0x1810 kernel/signal.c:2635 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (rfcomm_mutex){+.+.}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 rfcomm_dlc_open+0x25/0x50 net/bluetooth/rfcomm/core.c:425 rfcomm_sock_connect+0x285/0x470 net/bluetooth/rfcomm/sock.c:413 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x29b/0x2d0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 lock_sock_nested+0x44/0xf0 net/core/sock.c:3447 lock_sock include/net/sock.h:1721 [inline] rfcomm_sk_state_change+0x52/0x2f0 net/bluetooth/rfcomm/sock.c:73 __rfcomm_dlc_close+0x2bb/0x470 net/bluetooth/rfcomm/core.c:489 rfcomm_dlc_close+0x10d/0x1c0 net/bluetooth/rfcomm/core.c:520 __rfcomm_sock_close+0x101/0x220 net/bluetooth/rfcomm/sock.c:220 rfcomm_sock_shutdown+0xad/0x230 net/bluetooth/rfcomm/sock.c:907 rfcomm_sock_release+0x55/0x120 net/bluetooth/rfcomm/sock.c:928 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3ba/0x880 fs/file_table.c:320 task_work_run+0x243/0x300 kernel/task_work.c:179 get_signal+0x1642/0x1810 kernel/signal.c:2635 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM --> rfcomm_mutex --> &d->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&d->lock); lock(rfcomm_mutex); lock(&d->lock); lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM); *** DEADLOCK *** 3 locks held by syz-executor.0/4119: #0: ffff888071526e10 (&sb->s_type->i_mutex_key#9){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #0: ffff888071526e10 (&sb->s_type->i_mutex_key#9){+.+.}-{3:3}, at: __sock_release net/socket.c:649 [inline] #0: ffff888071526e10 (&sb->s_type->i_mutex_key#9){+.+.}-{3:3}, at: sock_close+0x93/0x260 net/socket.c:1365 #1: ffffffff8e5df5c8 (rfcomm_mutex){+.+.}-{3:3}, at: rfcomm_dlc_close+0x32/0x1c0 net/bluetooth/rfcomm/core.c:507 #2: ffff88806fbefd28 (&d->lock){+.+.}-{3:3}, at: __rfcomm_dlc_close+0x276/0x470 net/bluetooth/rfcomm/core.c:487 stack backtrace: CPU: 0 PID: 4119 Comm: syz-executor.0 Not tainted 6.1.0-rc8-syzkaller-00148-g0d1409e4ff08 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 lock_sock_nested+0x44/0xf0 net/core/sock.c:3447 lock_sock include/net/sock.h:1721 [inline] rfcomm_sk_state_change+0x52/0x2f0 net/bluetooth/rfcomm/sock.c:73 __rfcomm_dlc_close+0x2bb/0x470 net/bluetooth/rfcomm/core.c:489 rfcomm_dlc_close+0x10d/0x1c0 net/bluetooth/rfcomm/core.c:520 __rfcomm_sock_close+0x101/0x220 net/bluetooth/rfcomm/sock.c:220 rfcomm_sock_shutdown+0xad/0x230 net/bluetooth/rfcomm/sock.c:907 rfcomm_sock_release+0x55/0x120 net/bluetooth/rfcomm/sock.c:928 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3ba/0x880 fs/file_table.c:320 task_work_run+0x243/0x300 kernel/task_work.c:179 get_signal+0x1642/0x1810 kernel/signal.c:2635 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0542689049 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0543727168 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffffc RBX: 00007f054279bf60 RCX: 00007f0542689049 RDX: 0000000000000080 RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007f05426e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff6f24427f R14: 00007f0543727300 R15: 0000000000022000