====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ krfcommd/2852 is trying to acquire lock: ffff0000dcf9f148 ((wq_completion)hci2){+.+.}-{0:0}, at: touch_wq_lockdep_map+0xac/0x15c kernel/workqueue.c:4272 but task is already holding lock: ffff80008ad7ad20 (rfcomm_mutex){+.+.}-{4:4}, at: rfcomm_process_sessions net/bluetooth/rfcomm/core.c:2150 [inline] ffff80008ad7ad20 (rfcomm_mutex){+.+.}-{4:4}, at: rfcomm_run+0x35c/0x4c98 net/bluetooth/rfcomm/core.c:2259 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #6 (rfcomm_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x164/0x10b8 kernel/locking/mutex.c:821 mutex_lock_nested+0x24/0x30 kernel/locking/mutex.c:874 rfcomm_dlc_open+0xc8/0x69c net/bluetooth/rfcomm/core.c:422 rfcomm_dev_activate+0x64/0xf8 net/bluetooth/rfcomm/tty.c:112 tty_port_open+0x10c/0x228 drivers/tty/tty_port.c:798 rfcomm_tty_open+0xbc/0x458 net/bluetooth/rfcomm/tty.c:744 tty_open+0x408/0x934 drivers/tty/tty_io.c:2112 chrdev_open+0x398/0x3e8 fs/char_dev.c:413 do_dentry_open+0x5bc/0xfb4 fs/open.c:1000 vfs_open_consume+0x54/0x2ec fs/open.c:1131 do_open fs/namei.c:4851 [inline] path_openat+0x1098/0x1910 fs/namei.c:5016 do_file_open+0x1c8/0x2e8 fs/namei.c:5045 do_sys_openat2+0x114/0x1ec fs/open.c:1443 do_sys_open+0xb0/0xe0 fs/open.c:1449 __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __arm64_sys_openat+0xa8/0xc4 fs/open.c:1460 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140 el0_svc+0x60/0x1d8 arch/arm64/kernel/entry-common.c:797 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:816 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606 -> #5 (&port->mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x164/0x10b8 kernel/locking/mutex.c:821 mutex_lock_nested+0x24/0x30 kernel/locking/mutex.c:874 class_mutex_constructor include/linux/mutex.h:253 [inline] uart_set_termios+0x74/0x5d0 drivers/tty/serial/serial_core.c:1672 tty_set_termios+0x3b0/0x6d0 drivers/tty/tty_ioctl.c:341 set_termios+0x428/0x664 drivers/tty/tty_ioctl.c:516 tty_mode_ioctl+0x45c/0x7f4 drivers/tty/tty_ioctl.c:-1 n_tty_ioctl_helper+0xa8/0x2d8 drivers/tty/tty_ioctl.c:982 n_tty_ioctl+0x190/0x434 drivers/tty/n_tty.c:2496 tty_ioctl+0x8ac/0xd04 drivers/tty/tty_io.c:2791 vfs_ioctl fs/ioctl.c:52 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl fs/ioctl.c:584 [inline] __arm64_sys_ioctl+0x154/0x1cc fs/ioctl.c:584 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140 el0_svc+0x60/0x1d8 arch/arm64/kernel/entry-common.c:797 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:816 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606 -> #4 (&tty->termios_rwsem){++++}-{4:4}: down_write+0xac/0x2a8 kernel/locking/rwsem.c:1631 class_rwsem_write_constructor include/linux/rwsem.h:270 [inline] n_tty_flush_buffer+0x2c/0xa4 drivers/tty/n_tty.c:349 tty_buffer_flush+0x1b8/0x2b4 drivers/tty/tty_buffer.c:248 tty_ldisc_flush+0x30/0x7c drivers/tty/tty_ldisc.c:388 tty_port_close_start+0x278/0x488 drivers/tty/tty_port.c:677 tty_port_close+0x34/0x124 drivers/tty/tty_port.c:732 rfcomm_tty_close+0x60/0x110 net/bluetooth/rfcomm/tty.c:767 tty_release+0x2c4/0xffc drivers/tty/tty_io.c:1720 tty_open+0x470/0x934 drivers/tty/tty_io.c:2121 chrdev_open+0x398/0x3e8 fs/char_dev.c:413 do_dentry_open+0x5bc/0xfb4 fs/open.c:1000 vfs_open_consume+0x54/0x2ec fs/open.c:1131 do_open fs/namei.c:4851 [inline] path_openat+0x1098/0x1910 fs/namei.c:5016 do_file_open+0x1c8/0x2e8 fs/namei.c:5045 do_sys_openat2+0x114/0x1ec fs/open.c:1443 do_sys_open+0xb0/0xe0 fs/open.c:1449 __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __arm64_sys_openat+0xa8/0xc4 fs/open.c:1460 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140 el0_svc+0x60/0x1d8 arch/arm64/kernel/entry-common.c:797 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:816 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606 -> #3 (&buf->lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x164/0x10b8 kernel/locking/mutex.c:821 mutex_lock_nested+0x24/0x30 kernel/locking/mutex.c:874 tty_buffer_flush+0x78/0x2b4 drivers/tty/tty_buffer.c:236 tty_ldisc_flush+0x30/0x7c drivers/tty/tty_ldisc.c:388 hci_uart_flush+0xc8/0x248 drivers/bluetooth/hci_ldisc.c:255 hci_uart_close+0x28/0xa8 drivers/bluetooth/hci_ldisc.c:292 hci_dev_drop_last_cmd_req_and_close+0x148/0x1bc net/bluetooth/hci_sync.c:5632 hci_dev_open_sync+0xe08/0x1bd4 net/bluetooth/hci_sync.c:5724 hci_dev_do_open+0x34/0xbc net/bluetooth/hci_core.c:431 hci_power_on+0x138/0x56c net/bluetooth/hci_core.c:923 process_one_work kernel/workqueue.c:3495 [inline] process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578 worker_thread+0x798/0xbd0 kernel/workqueue.c:3659 kthread+0x304/0x3d4 kernel/kthread.c:436 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854 -> #2 (&hdev->req_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x164/0x10b8 kernel/locking/mutex.c:821 mutex_lock_nested+0x24/0x30 kernel/locking/mutex.c:874 hci_dev_do_open+0x2c/0xbc net/bluetooth/hci_core.c:429 hci_power_on+0x138/0x56c net/bluetooth/hci_core.c:923 process_one_work kernel/workqueue.c:3495 [inline] process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578 worker_thread+0x798/0xbd0 kernel/workqueue.c:3659 kthread+0x304/0x3d4 kernel/kthread.c:436 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854 -> #1 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}: process_one_work kernel/workqueue.c:3471 [inline] process_scheduled_works+0x8f0/0x1250 kernel/workqueue.c:3578 worker_thread+0x798/0xbd0 kernel/workqueue.c:3659 kthread+0x304/0x3d4 kernel/kthread.c:436 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854 -> #0 ((wq_completion)hci2){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1660/0x2b08 kernel/locking/lockdep.c:5288 lock_acquire+0x13c/0x320 kernel/locking/lockdep.c:5942 touch_wq_lockdep_map+0xb4/0x15c kernel/workqueue.c:4272 __flush_workqueue+0x114/0xd74 kernel/workqueue.c:4314 drain_workqueue+0xa4/0x310 kernel/workqueue.c:4478 destroy_workqueue+0xb4/0x6ec kernel/workqueue.c:6372 hci_release_dev+0xc8/0x3f8 net/bluetooth/hci_core.c:2742 bt_host_release+0x7c/0x98 net/bluetooth/hci_sysfs.c:100 device_release+0xb4/0x1d4 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1dc/0x4b8 lib/kobject.c:737 put_device+0x28/0x40 drivers/base/core.c:3886 bt_link_release+0x50/0x60 net/bluetooth/hci_sysfs.c:19 device_release+0xb4/0x1d4 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1dc/0x4b8 lib/kobject.c:737 put_device+0x28/0x40 drivers/base/core.c:3886 hci_conn_put include/net/bluetooth/hci_core.h:1739 [inline] l2cap_conn_free net/bluetooth/l2cap_core.c:1978 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_conn_put+0x80/0xec net/bluetooth/l2cap_core.c:1991 l2cap_chan_destroy net/bluetooth/l2cap_core.c:510 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_chan_put+0x18c/0x2ac net/bluetooth/l2cap_core.c:537 l2cap_sock_release+0x17c/0x208 net/bluetooth/l2cap_sock.c:1545 __sock_release+0xf8/0x1d4 net/socket.c:735 sock_release+0x24/0x34 net/socket.c:763 rfcomm_session_del+0x130/0x1d4 net/bluetooth/rfcomm/core.c:782 rfcomm_session_close+0xf0/0x168 net/bluetooth/rfcomm/core.c:821 rfcomm_process_sessions net/bluetooth/rfcomm/core.c:-1 [inline] rfcomm_run+0x3a50/0x4c98 net/bluetooth/rfcomm/core.c:2259 kthread+0x304/0x3d4 kernel/kthread.c:436 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854 other info that might help us debug this: Chain exists of: (wq_completion)hci2 --> &port->mutex --> rfcomm_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rfcomm_mutex); lock(&port->mutex); lock(rfcomm_mutex); lock((wq_completion)hci2); *** DEADLOCK *** locks held by krfcommd/2852: 1, on CPU#0: #0: ffff80008ad7ad20 (rfcomm_mutex){+.+.}-{4:4}, at: rfcomm_process_sessions net/bluetooth/rfcomm/core.c:2150 [inline] #0: ffff80008ad7ad20 (rfcomm_mutex){+.+.}-{4:4}, at: rfcomm_run+0x35c/0x4c98 net/bluetooth/rfcomm/core.c:2259 stack backtrace: CPU: 0 UID: 0 PID: 2852 Comm: krfcommd Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x328/0x330 kernel/locking/lockdep.c:2087 check_noncircular+0x158/0x174 kernel/locking/lockdep.c:2219 check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1660/0x2b08 kernel/locking/lockdep.c:5288 lock_acquire+0x13c/0x320 kernel/locking/lockdep.c:5942 touch_wq_lockdep_map+0xb4/0x15c kernel/workqueue.c:4272 __flush_workqueue+0x114/0xd74 kernel/workqueue.c:4314 drain_workqueue+0xa4/0x310 kernel/workqueue.c:4478 destroy_workqueue+0xb4/0x6ec kernel/workqueue.c:6372 hci_release_dev+0xc8/0x3f8 net/bluetooth/hci_core.c:2742 bt_host_release+0x7c/0x98 net/bluetooth/hci_sysfs.c:100 device_release+0xb4/0x1d4 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1dc/0x4b8 lib/kobject.c:737 put_device+0x28/0x40 drivers/base/core.c:3886 bt_link_release+0x50/0x60 net/bluetooth/hci_sysfs.c:19 device_release+0xb4/0x1d4 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1dc/0x4b8 lib/kobject.c:737 put_device+0x28/0x40 drivers/base/core.c:3886 hci_conn_put include/net/bluetooth/hci_core.h:1739 [inline] l2cap_conn_free net/bluetooth/l2cap_core.c:1978 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_conn_put+0x80/0xec net/bluetooth/l2cap_core.c:1991 l2cap_chan_destroy net/bluetooth/l2cap_core.c:510 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_chan_put+0x18c/0x2ac net/bluetooth/l2cap_core.c:537 l2cap_sock_release+0x17c/0x208 net/bluetooth/l2cap_sock.c:1545 __sock_release+0xf8/0x1d4 net/socket.c:735 sock_release+0x24/0x34 net/socket.c:763 rfcomm_session_del+0x130/0x1d4 net/bluetooth/rfcomm/core.c:782 rfcomm_session_close+0xf0/0x168 net/bluetooth/rfcomm/core.c:821 rfcomm_process_sessions net/bluetooth/rfcomm/core.c:-1 [inline] rfcomm_run+0x3a50/0x4c98 net/bluetooth/rfcomm/core.c:2259 kthread+0x304/0x3d4 kernel/kthread.c:436 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854