hcon ffff88807b4f8000 hci3: conn ffff88807b4f8000 device: 'hci3:201': device_unregister ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ kworker/u9:0/52 is trying to acquire lock: ffff88801deaf980 (&root->kernfs_rwsem){++++}-{4:4}, at: kernfs_remove_by_name_ns+0x51/0x120 fs/kernfs/dir.c:1791 but task is already holding lock: ffff88801deafaa0 (&root->kernfs_supers_rwsem){++++}-{4:4}, at: kernfs_remove_by_name_ns+0x49/0x120 fs/kernfs/dir.c:1790 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #8 (&root->kernfs_supers_rwsem){++++}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 down_read+0x94/0x4c0 kernel/locking/rwsem.c:1574 kernfs_remove_by_name_ns+0x49/0x120 fs/kernfs/dir.c:1790 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] remove_files+0x96/0x1c0 fs/sysfs/group.c:28 sysfs_remove_group+0x8b/0x1b0 fs/sysfs/group.c:328 topology_remove_dev+0x22/0x30 drivers/base/topology.c:199 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline] cpuhp_down_callbacks kernel/cpu.c:1386 [inline] _cpu_down+0x523/0x1020 kernel/cpu.c:1457 cpu_down_maps_locked kernel/cpu.c:1483 [inline] cpuhp_smt_disable+0x11f/0x1f0 kernel/cpu.c:2670 __store_smt_control kernel/cpu.c:2938 [inline] control_store+0x1a2/0x320 kernel/cpu.c:2983 dev_attr_store+0x58/0x80 drivers/base/core.c:2509 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6af/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #7 (cpu_hotplug_lock){++++}-{0:0}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read include/linux/percpu-rwsem.h:77 [inline] cpus_read_lock+0x3d/0x170 kernel/cpu.c:490 static_key_slow_inc+0x12/0x30 kernel/jump_label.c:190 nbd_genl_reconnect_sock_cb+0x39f/0x990 drivers/block/nbd.c:1377 nbd_genl_foreach_sock+0x2ab/0x3e0 drivers/block/nbd.c:2152 nbd_genl_reconfigure+0x861/0xde0 drivers/block/nbd.c:2477 genl_family_rcv_msg_doit+0x214/0x300 net/netlink/genetlink.c:1114 genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline] genl_rcv_msg+0x560/0x800 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2584 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x668/0x950 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x9ac/0x10c0 net/netlink/af_netlink.c:1920 sock_sendmsg_nosec net/socket.c:800 [inline] __sock_sendmsg net/socket.c:818 [inline] ____sys_sendmsg+0xa99/0xc30 net/socket.c:2715 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2769 __sys_sendmsg+0x160/0x210 net/socket.c:2801 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #6 (&nsock->tx_lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19f/0x1c10 kernel/locking/mutex.c:821 nbd_handle_cmd drivers/block/nbd.c:1143 [inline] nbd_queue_rq+0x42d/0xfa0 drivers/block/nbd.c:1207 blk_mq_dispatch_rq_list+0x428/0x1e60 block/blk-mq.c:2141 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline] blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline] __blk_mq_sched_dispatch_requests+0xcea/0x1620 block/blk-mq-sched.c:307 blk_mq_sched_dispatch_requests+0xd7/0x1c0 block/blk-mq-sched.c:329 blk_mq_run_work_fn+0x130/0x380 block/blk-mq.c:2555 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #5 (&cmd->lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19f/0x1c10 kernel/locking/mutex.c:821 nbd_queue_rq+0xba/0xfa0 drivers/block/nbd.c:1199 blk_mq_dispatch_rq_list+0x428/0x1e60 block/blk-mq.c:2141 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline] blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline] __blk_mq_sched_dispatch_requests+0xcea/0x1620 block/blk-mq-sched.c:307 blk_mq_sched_dispatch_requests+0xd7/0x1c0 block/blk-mq-sched.c:329 blk_mq_run_work_fn+0x130/0x380 block/blk-mq.c:2555 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #4 (set->srcu){.+.+}-{0:0}: lock_sync kernel/locking/lockdep.c:5991 [inline] lock_sync+0xb5/0x120 kernel/locking/lockdep.c:5979 srcu_lock_sync include/linux/srcu.h:225 [inline] __synchronize_srcu+0xa2/0x310 kernel/rcu/srcutree.c:1662 blk_mq_wait_quiesce_done block/blk-mq.c:284 [inline] blk_mq_wait_quiesce_done block/blk-mq.c:281 [inline] blk_mq_quiesce_queue block/blk-mq.c:304 [inline] blk_mq_quiesce_queue+0x149/0x1c0 block/blk-mq.c:299 elevator_switch+0x17b/0x7e0 block/elevator.c:576 elevator_change+0x352/0x530 block/elevator.c:681 elevator_set_default+0x29e/0x360 block/elevator.c:754 blk_register_queue+0x49e/0x640 block/blk-sysfs.c:992 __add_disk+0x7dd/0xf10 block/genhd.c:531 add_disk_fwnode+0x118/0x480 block/genhd.c:600 add_disk include/linux/blkdev.h:801 [inline] nbd_dev_add+0x779/0xb10 drivers/block/nbd.c:2026 nbd_init+0x2c5/0x2e0 drivers/block/nbd.c:2743 do_one_initcall+0x11c/0x6f0 init/main.c:1419 do_initcall_level init/main.c:1481 [inline] do_initcalls init/main.c:1497 [inline] do_basic_setup init/main.c:1517 [inline] kernel_init_freeable+0x6ea/0x7b0 init/main.c:1732 kernel_init+0x21/0x1e0 init/main.c:1622 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #3 (&q->elevator_lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19f/0x1c10 kernel/locking/mutex.c:821 elevator_change+0x1bc/0x530 block/elevator.c:679 elv_iosched_store+0x3be/0x460 block/elevator.c:826 queue_attr_store+0x25f/0x2f0 block/blk-sysfs.c:906 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6af/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&q->q_usage_counter(io)#17){++++}-{0:0}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 blk_alloc_queue+0x610/0x790 block/blk-core.c:505 blk_mq_alloc_queue+0x174/0x290 block/blk-mq.c:4460 __blk_mq_alloc_disk+0x29/0x120 block/blk-mq.c:4507 loop_add+0x498/0xb60 drivers/block/loop.c:1971 loop_init+0x1d3/0x200 drivers/block/loop.c:2210 do_one_initcall+0x11c/0x6f0 init/main.c:1419 do_initcall_level init/main.c:1481 [inline] do_initcalls init/main.c:1497 [inline] do_basic_setup init/main.c:1517 [inline] kernel_init_freeable+0x6ea/0x7b0 init/main.c:1732 kernel_init+0x21/0x1e0 init/main.c:1622 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #1 (fs_reclaim){+.+.}-{0:0}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __fs_reclaim_acquire mm/page_alloc.c:4360 [inline] fs_reclaim_acquire+0xc4/0x100 mm/page_alloc.c:4374 might_alloc include/linux/sched/mm.h:316 [inline] slab_pre_alloc_hook mm/slub.c:4673 [inline] slab_alloc_node mm/slub.c:5011 [inline] kmem_cache_alloc_lru_noprof+0x5f/0x6a0 mm/slub.c:5066 alloc_inode+0x183/0x250 fs/inode.c:340 iget_locked+0x1d4/0x6c0 fs/inode.c:1483 kernfs_get_inode+0x46/0x470 fs/kernfs/inode.c:250 kernfs_fill_super fs/kernfs/mount.c:318 [inline] kernfs_get_tree+0x648/0xbc0 fs/kernfs/mount.c:402 vfs_get_tree+0x92/0x320 fs/super.c:1881 fc_mount fs/namespace.c:1282 [inline] do_new_mount_fc fs/namespace.c:3910 [inline] do_new_mount fs/namespace.c:3986 [inline] path_mount+0x7d0/0x2850 fs/namespace.c:4337 do_mount fs/namespace.c:4350 [inline] __do_sys_mount fs/namespace.c:4565 [inline] __se_sys_mount fs/namespace.c:4542 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4542 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&root->kernfs_rwsem){++++}-{4:4}: check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 down_write+0x86/0x1f0 kernel/locking/rwsem.c:1631 kernfs_remove_by_name_ns+0x51/0x120 fs/kernfs/dir.c:1791 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] sysfs_unmerge_group+0xe7/0x170 fs/sysfs/group.c:408 dpm_sysfs_remove+0x68/0xb0 drivers/base/power/sysfs.c:830 device_del+0x180/0x9b0 drivers/base/core.c:3942 device_unregister+0x1d/0xe0 drivers/base/core.c:4008 hci_conn_del_sysfs+0xb9/0x1a0 net/bluetooth/hci_sysfs.c:92 hci_conn_cleanup net/bluetooth/hci_conn.c:170 [inline] hci_conn_del+0x668/0x1210 net/bluetooth/hci_conn.c:1362 hci_abort_conn_sync+0x8ab/0xbf0 net/bluetooth/hci_sync.c:6073 abort_conn_sync+0x142/0x350 net/bluetooth/hci_conn.c:3243 hci_cmd_sync_work+0x1b6/0x4c0 net/bluetooth/hci_sync.c:338 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 other info that might help us debug this: Chain exists of: &root->kernfs_rwsem --> cpu_hotplug_lock --> &root->kernfs_supers_rwsem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&root->kernfs_supers_rwsem); lock(cpu_hotplug_lock); lock(&root->kernfs_supers_rwsem); lock(&root->kernfs_rwsem); *** DEADLOCK *** locks held by kworker/u9:0/52: 5, last CPU#0: #0: ffff888024f6e148 ((wq_completion)hci3){+.+.}-{0:0}, at: process_one_work+0x1461/0x1b10 kernel/workqueue.c:3470 #1: ffffc90000bd7d08 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: process_one_work+0xa2c/0x1b10 kernel/workqueue.c:3471 #2: ffff88807d79cea0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_cmd_sync_work+0x180/0x4c0 net/bluetooth/hci_sync.c:337 #3: ffff88807d79c0b8 (&hdev->lock){+.+.}-{4:4}, at: hci_abort_conn_sync+0x141/0xbf0 net/bluetooth/hci_sync.c:6054 #4: ffff88801deafaa0 (&root->kernfs_supers_rwsem){++++}-{4:4}, at: kernfs_remove_by_name_ns+0x49/0x120 fs/kernfs/dir.c:1790 stack backtrace: CPU: 0 UID: 0 PID: 52 Comm: kworker/u9:0 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026 Workqueue: hci3 hci_cmd_sync_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2087 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2219 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 down_write+0x86/0x1f0 kernel/locking/rwsem.c:1631 kernfs_remove_by_name_ns+0x51/0x120 fs/kernfs/dir.c:1791 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] sysfs_unmerge_group+0xe7/0x170 fs/sysfs/group.c:408 dpm_sysfs_remove+0x68/0xb0 drivers/base/power/sysfs.c:830 device_del+0x180/0x9b0 drivers/base/core.c:3942 device_unregister+0x1d/0xe0 drivers/base/core.c:4008 hci_conn_del_sysfs+0xb9/0x1a0 net/bluetooth/hci_sysfs.c:92 hci_conn_cleanup net/bluetooth/hci_conn.c:170 [inline] hci_conn_del+0x668/0x1210 net/bluetooth/hci_conn.c:1362 hci_abort_conn_sync+0x8ab/0xbf0 net/bluetooth/hci_sync.c:6073 abort_conn_sync+0x142/0x350 net/bluetooth/hci_conn.c:3243 hci_cmd_sync_work+0x1b6/0x4c0 net/bluetooth/hci_sync.c:338 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs device: removing kernfs subsystem: removing kernfs hci3:201: removing kernfs uevent: removing PM: Removing info for No Bus:hci3:201 kobject: 'hci3:201' (ffff88807b4f8cf0): kobject_uevent_env kobject: 'hci3:201' (ffff88807b4f8cf0): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/hci3:201' kernfs hci3:201: removing hci3 orig refcnt 14 kobject: 'hci3:201' (ffff88807b4f8cf0): kobject_cleanup, parent 0000000000000000 kobject: 'hci3:201' (ffff88807b4f8cf0): calling ktype release kobject: 'hci3:201': free name