syzbot
possible deadlock in rfcomm_dlc_close
Status:
upstream: reported on 2026/09/15 19:55
Reported-by: syzbot+1c517b5ba3ebfe65599a@syzkaller.appspotmail.com
First crash: 3d10h, last: 3d09h
Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.1224/11541 is trying to acquire lock:
ffffffff8e562248 (rfcomm_mutex){+.+.}-{3:3}, at: rfcomm_dlc_close+0x39/0x180 net/bluetooth/rfcomm/core.c:511
but task is already holding lock:
ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1780 [inline]
ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: rfcomm_sock_close net/bluetooth/rfcomm/sock.c:246 [inline]
ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: rfcomm_sock_cleanup_listen net/bluetooth/rfcomm/sock.c:191 [inline]
ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: __rfcomm_sock_close+0xe8/0x2d0 net/bluetooth/rfcomm/sock.c:225
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}:
lock_sock_nested+0x48/0x100 net/core/sock.c:3543
lock_sock include/net/sock.h:1780 [inline]
rfcomm_connect_ind+0x4f0/0xd90 net/bluetooth/rfcomm/sock.c:966
rfcomm_recv_pn net/bluetooth/rfcomm/core.c:1512 [inline]
rfcomm_recv_mcc net/bluetooth/rfcomm/core.c:1730 [inline]
rfcomm_recv_frame net/bluetooth/rfcomm/core.c:1863 [inline]
rfcomm_process_rx net/bluetooth/rfcomm/core.c:2015 [inline]
rfcomm_process_sessions net/bluetooth/rfcomm/core.c:2108 [inline]
rfcomm_run+0x2ba9/0x5e50 net/bluetooth/rfcomm/core.c:2196
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
-> #0 (rfcomm_mutex){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5756
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
rfcomm_dlc_close+0x39/0x180 net/bluetooth/rfcomm/core.c:511
__rfcomm_sock_close+0x1a4/0x2d0 net/bluetooth/rfcomm/sock.c:232
rfcomm_sock_close net/bluetooth/rfcomm/sock.c:247 [inline]
rfcomm_sock_cleanup_listen net/bluetooth/rfcomm/sock.c:191 [inline]
__rfcomm_sock_close+0xf0/0x2d0 net/bluetooth/rfcomm/sock.c:225
rfcomm_sock_shutdown+0xb9/0x240 net/bluetooth/rfcomm/sock.c:918
rfcomm_sock_release+0x59/0x120 net/bluetooth/rfcomm/sock.c:939
__sock_release net/socket.c:659 [inline]
sock_close+0xa7/0x210 net/socket.c:1421
__fput+0x221/0x940 fs/file_table.c:418
task_work_run+0x1d4/0x260 kernel/task_work.c:245
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213
__syscall_exit_to_user_mode_work kernel/entry/common.c:294 [inline]
syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:305
do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x68/0xd2
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM);
lock(rfcomm_mutex);
lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM);
lock(rfcomm_mutex);
*** DEADLOCK ***
2 locks held by syz.2.1224/11541:
#0: ffff8880785d5c20 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
#0: ffff8880785d5c20 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: __sock_release net/socket.c:658 [inline]
#0: ffff8880785d5c20 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: sock_close+0x82/0x210 net/socket.c:1421
#1: ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1780 [inline]
#1: ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: rfcomm_sock_close net/bluetooth/rfcomm/sock.c:246 [inline]
#1: ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: rfcomm_sock_cleanup_listen net/bluetooth/rfcomm/sock.c:191 [inline]
#1: ffff88806518c130 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: __rfcomm_sock_close+0xe8/0x2d0 net/bluetooth/rfcomm/sock.c:225
stack backtrace:
CPU: 0 PID: 11541 Comm: syz.2.1224 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5756
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
rfcomm_dlc_close+0x39/0x180 net/bluetooth/rfcomm/core.c:511
__rfcomm_sock_close+0x1a4/0x2d0 net/bluetooth/rfcomm/sock.c:232
rfcomm_sock_close net/bluetooth/rfcomm/sock.c:247 [inline]
rfcomm_sock_cleanup_listen net/bluetooth/rfcomm/sock.c:191 [inline]
__rfcomm_sock_close+0xf0/0x2d0 net/bluetooth/rfcomm/sock.c:225
rfcomm_sock_shutdown+0xb9/0x240 net/bluetooth/rfcomm/sock.c:918
rfcomm_sock_release+0x59/0x120 net/bluetooth/rfcomm/sock.c:939
__sock_release net/socket.c:659 [inline]
sock_close+0xa7/0x210 net/socket.c:1421
__fput+0x221/0x940 fs/file_table.c:418
task_work_run+0x1d4/0x260 kernel/task_work.c:245
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213
__syscall_exit_to_user_mode_work kernel/entry/common.c:294 [inline]
syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:305
do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fb2c599e159
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:00007ffe133e3258 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007ffe133e3340 RCX: 00007fb2c599e159
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 000000000007b944 R08: 0000000000000001 R09: 0000000000000000
R10: 0000001b2d320000 R11: 0000000000000246 R12: 00007ffe133e3380
R13: 00007fb2c5c25fac R14: 000000000007b9a7 R15: 00007fb2c5c25fa0
</TASK>
* Struck through repros no longer work on HEAD.