syzbot


possible deadlock in rfcomm_dlc_exists

Status: auto-obsoleted due to no activity on 2024/12/24 19:06
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+de82738425bd819f2b1e@syzkaller.appspotmail.com
First crash: 670d, last: 98d
Fix bisection: failed (error log, bisect log)
  
Bug presence (2)
Date Name Commit Repro Result
2024/04/24 upstream (ToT) e88c4cfcb7b8 C [report] possible deadlock in rfcomm_sk_state_change
2024/10/25 upstream (ToT) c71f8fb4dc91 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in rfcomm_dlc_exists 335 96d 670d 0/3 auto-obsoleted due to no activity on 2024/12/26 09:32
upstream possible deadlock in rfcomm_dlc_exists bluetooth C error done 13649 98d 732d 0/28 auto-obsoleted due to no activity on 2024/12/24 07:40

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.167-syzkaller #0 Not tainted
------------------------------------------------------
syz.4.1083/7318 is trying to acquire lock:
ffffffff8db9a628 (rfcomm_mutex){+.+.}-{3:3}, at: rfcomm_dlc_exists+0xa2/0x370 net/bluetooth/rfcomm/core.c:542

but task is already holding lock:
ffffffff8db9e008 (rfcomm_ioctl_mutex){+.+.}-{3:3}, at: rfcomm_create_dev net/bluetooth/rfcomm/tty.c:485 [inline]
ffffffff8db9e008 (rfcomm_ioctl_mutex){+.+.}-{3:3}, at: rfcomm_dev_ioctl+0x233/0x2180 net/bluetooth/rfcomm/tty.c:588

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (rfcomm_ioctl_mutex){+.+.}-{3:3}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       rfcomm_release_dev net/bluetooth/rfcomm/tty.c:496 [inline]
       rfcomm_dev_ioctl+0x164/0x2180 net/bluetooth/rfcomm/tty.c:591
       rfcomm_sock_ioctl+0x82/0xc0 net/bluetooth/rfcomm/sock.c:880
       sock_do_ioctl+0x11d/0x5a0 net/socket.c:1140
       sock_ioctl+0x47f/0x770 net/socket.c:1257
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       lock_sock_nested+0x44/0x100 net/core/sock.c:3250
       lock_sock include/net/sock.h:1676 [inline]
       rfcomm_sk_state_change+0x57/0x300 net/bluetooth/rfcomm/sock.c:73
       __rfcomm_dlc_close+0x2b2/0x6d0 net/bluetooth/rfcomm/core.c:489
       rfcomm_dlc_close+0xed/0x180 net/bluetooth/rfcomm/core.c:520
       __rfcomm_sock_close+0x104/0x220 net/bluetooth/rfcomm/sock.c:220
       rfcomm_sock_shutdown+0xb4/0x230 net/bluetooth/rfcomm/sock.c:912
       rfcomm_sock_release+0x55/0x110 net/bluetooth/rfcomm/sock.c:933
       __sock_release net/socket.c:649 [inline]
       sock_close+0xcd/0x230 net/socket.c:1336
       __fput+0x3fe/0x8e0 fs/file_table.c:280
       task_work_run+0x129/0x1a0 kernel/task_work.c:188
       tracehook_notify_signal include/linux/tracehook.h:214 [inline]
       handle_signal_work kernel/entry/common.c:152 [inline]
       exit_to_user_mode_loop+0x86/0x130 kernel/entry/common.c:178
       exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
       __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
       syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
       do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&d->lock){+.+.}-{3:3}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       __rfcomm_dlc_close+0x259/0x6d0 net/bluetooth/rfcomm/core.c:487
       rfcomm_dlc_close+0xed/0x180 net/bluetooth/rfcomm/core.c:520
       __rfcomm_sock_close+0x104/0x220 net/bluetooth/rfcomm/sock.c:220
       rfcomm_sock_shutdown+0xb4/0x230 net/bluetooth/rfcomm/sock.c:912
       rfcomm_sock_release+0x55/0x110 net/bluetooth/rfcomm/sock.c:933
       __sock_release net/socket.c:649 [inline]
       sock_close+0xcd/0x230 net/socket.c:1336
       __fput+0x3fe/0x8e0 fs/file_table.c:280
       task_work_run+0x129/0x1a0 kernel/task_work.c:188
       tracehook_notify_signal include/linux/tracehook.h:214 [inline]
       handle_signal_work kernel/entry/common.c:152 [inline]
       exit_to_user_mode_loop+0x86/0x130 kernel/entry/common.c:178
       exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
       __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
       syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
       do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (rfcomm_mutex){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       rfcomm_dlc_exists+0xa2/0x370 net/bluetooth/rfcomm/core.c:542
       __rfcomm_create_dev net/bluetooth/rfcomm/tty.c:415 [inline]
       rfcomm_create_dev net/bluetooth/rfcomm/tty.c:486 [inline]
       rfcomm_dev_ioctl+0xb2d/0x2180 net/bluetooth/rfcomm/tty.c:588
       rfcomm_sock_ioctl+0x82/0xc0 net/bluetooth/rfcomm/sock.c:880
       sock_do_ioctl+0x11d/0x5a0 net/socket.c:1140
       sock_ioctl+0x47f/0x770 net/socket.c:1257
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
  rfcomm_mutex --> sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM --> rfcomm_ioctl_mutex

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(rfcomm_ioctl_mutex);
                               lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM);
                               lock(rfcomm_ioctl_mutex);
  lock(rfcomm_mutex);

 *** DEADLOCK ***

2 locks held by syz.4.1083/7318:
 #0: ffff88806393b120 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1676 [inline]
 #0: ffff88806393b120 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: rfcomm_sock_ioctl+0x74/0xc0 net/bluetooth/rfcomm/sock.c:879
 #1: ffffffff8db9e008 (rfcomm_ioctl_mutex){+.+.}-{3:3}, at: rfcomm_create_dev net/bluetooth/rfcomm/tty.c:485 [inline]
 #1: ffffffff8db9e008 (rfcomm_ioctl_mutex){+.+.}-{3:3}, at: rfcomm_dev_ioctl+0x233/0x2180 net/bluetooth/rfcomm/tty.c:588

stack backtrace:
CPU: 1 PID: 7318 Comm: syz.4.1083 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 rfcomm_dlc_exists+0xa2/0x370 net/bluetooth/rfcomm/core.c:542
 __rfcomm_create_dev net/bluetooth/rfcomm/tty.c:415 [inline]
 rfcomm_create_dev net/bluetooth/rfcomm/tty.c:486 [inline]
 rfcomm_dev_ioctl+0xb2d/0x2180 net/bluetooth/rfcomm/tty.c:588
 rfcomm_sock_ioctl+0x82/0xc0 net/bluetooth/rfcomm/sock.c:880
 sock_do_ioctl+0x11d/0x5a0 net/socket.c:1140
 sock_ioctl+0x47f/0x770 net/socket.c:1257
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f24d432dff9
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
RSP: 002b:00007f24d2764038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f24d44e6130 RCX: 00007f24d432dff9
RDX: 0000000020000100 RSI: 00000000400452c8 RDI: 0000000000000009
RBP: 00007f24d43a0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f24d44e6130 R15: 00007ffe1dbadb68
 </TASK>

Crashes (388):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/13 04:59 linux-5.15.y 3a5928702e71 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/10/11 05:01 linux-5.15.y 3a5928702e71 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/10/09 02:35 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/10/07 06:57 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/10/03 15:36 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/10/02 01:05 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/29 21:32 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/27 19:03 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/23 10:15 linux-5.15.y 3a5928702e71 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/23 10:14 linux-5.15.y 3a5928702e71 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/22 17:35 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/21 20:55 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/19 19:01 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/14 17:25 linux-5.15.y 3a5928702e71 c7e35043 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/09/14 11:02 linux-5.15.y 3a5928702e71 c7e35043 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/23 01:44 linux-5.15.y 7c6d66f0266f 708c10c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/19 06:22 linux-5.15.y 7c6d66f0266f ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/16 16:09 linux-5.15.y f45bea23c39c b66b37bd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/15 11:40 linux-5.15.y f45bea23c39c c605e6a2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/05 09:30 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/05 09:30 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/03 22:28 linux-5.15.y 4878aadf2d15 f76a75f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/07/01 18:31 linux-5.15.y 4878aadf2d15 b294e901 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/05/02 17:56 linux-5.15.y 284087d4f7d5 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/05/01 10:16 linux-5.15.y b925f60c6ee7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/05/01 06:57 linux-5.15.y b925f60c6ee7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/05/01 05:39 linux-5.15.y b925f60c6ee7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/05/01 04:26 linux-5.15.y b925f60c6ee7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
2024/10/15 19:04 linux-5.15.y 3a5928702e71 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/10/15 18:01 linux-5.15.y 3a5928702e71 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/10/11 01:10 linux-5.15.y 3a5928702e71 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/10/10 03:06 linux-5.15.y 3a5928702e71 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/10/09 23:27 linux-5.15.y 3a5928702e71 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/10/05 19:22 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/09/30 12:36 linux-5.15.y 3a5928702e71 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/09/27 08:40 linux-5.15.y 3a5928702e71 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/09/19 01:15 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/09/02 08:28 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/08/26 08:08 linux-5.15.y fa93fa65db6e d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/08/22 05:00 linux-5.15.y fa93fa65db6e ca02180f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/08/20 13:05 linux-5.15.y fa93fa65db6e 9f0ab3fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/08/08 20:49 linux-5.15.y 7e89efd3ae1c 61405512 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/05/02 03:11 linux-5.15.y b925f60c6ee7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/04/29 12:54 linux-5.15.y b925f60c6ee7 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/04/29 00:54 linux-5.15.y b925f60c6ee7 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2024/04/24 08:35 linux-5.15.y c52b9710c83d 21339d7b .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfcomm_dlc_exists
2023/03/23 21:28 linux-5.15.y 115472395b0a f94b4a29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfcomm_dlc_exists
* Struck through repros no longer work on HEAD.