====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ cpuhp/1/18 is trying to acquire lock: ffff88802cf5c008 (kn->active#32){++++}-{0:0}, at: kernfs_remove_by_name_ns+0x91/0x100 fs/kernfs/dir.c:1566 but task is already holding lock: ffffffff8cfbd7e0 (cpuhp_state-down){+.+.}-{0:0}, at: cpuhp_lock_acquire+0x8/0x40 kernel/cpu.c:99 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (cpuhp_state-down){+.+.}-{0:0}: cpuhp_lock_acquire+0x3a/0x40 kernel/cpu.c:100 cpuhp_kick_ap_work+0x7f/0x1b0 kernel/cpu.c:901 _cpu_down+0x35b/0xbb0 kernel/cpu.c:1170 cpu_down_maps_locked kernel/cpu.c:1217 [inline] cpu_down kernel/cpu.c:1225 [inline] cpu_device_down+0x69/0xa0 kernel/cpu.c:1242 device_offline+0x259/0x3a0 drivers/base/core.c:3948 acpi_bus_offline+0x23e/0x400 drivers/acpi/scan.c:163 acpi_scan_try_to_offline drivers/acpi/scan.c:226 [inline] acpi_scan_hot_remove drivers/acpi/scan.c:258 [inline] acpi_generic_hotplug_event drivers/acpi/scan.c:374 [inline] acpi_device_hotplug+0x56c/0xc60 drivers/acpi/scan.c:398 acpi_hotplug_work_fn+0x8f/0xc0 drivers/acpi/osl.c:1160 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #3 (cpu_hotplug_lock){++++}-{0:0}: percpu_down_write+0x52/0x2f0 kernel/locking/percpu-rwsem.c:217 cpus_write_lock kernel/cpu.c:327 [inline] _cpu_up+0x77/0x810 kernel/cpu.c:1354 cpu_up+0x16d/0x1a0 kernel/cpu.c:1436 bringup_nonboot_cpus+0x100/0x1a0 kernel/cpu.c:1502 smp_init+0x3a/0x150 kernel/smp.c:1091 kernel_init_freeable+0x3bc/0x560 init/main.c:1581 kernel_init+0x19/0x1b0 init/main.c:1480 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #2 (cpu_add_remove_lock){+.+.}-{3:3}: __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 cpu_maps_update_begin kernel/cpu.c:289 [inline] cpu_down kernel/cpu.c:1224 [inline] cpu_device_down+0x3a/0xa0 kernel/cpu.c:1242 device_offline+0x259/0x3a0 drivers/base/core.c:3948 acpi_bus_offline+0x23e/0x400 drivers/acpi/scan.c:163 acpi_scan_try_to_offline drivers/acpi/scan.c:226 [inline] acpi_scan_hot_remove drivers/acpi/scan.c:258 [inline] acpi_generic_hotplug_event drivers/acpi/scan.c:374 [inline] acpi_device_hotplug+0x56c/0xc60 drivers/acpi/scan.c:398 acpi_hotplug_work_fn+0x8f/0xc0 drivers/acpi/osl.c:1160 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #1 (&device->physical_node_lock){+.+.}-{3:3}: __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 acpi_get_first_physical_node drivers/acpi/bus.c:644 [inline] acpi_primary_dev_companion drivers/acpi/bus.c:663 [inline] acpi_companion_match+0x86/0x110 drivers/acpi/bus.c:717 acpi_device_uevent_modalias+0x16/0x30 drivers/acpi/device_sysfs.c:283 platform_uevent+0x38/0xb0 drivers/base/platform.c:1357 dev_uevent+0x3a5/0x740 drivers/base/core.c:2344 kobject_uevent_env+0x465/0x890 lib/kobject_uevent.c:572 kobject_synth_uevent+0x457/0x940 lib/kobject_uevent.c:208 uevent_store+0x22/0x60 drivers/base/core.c:2428 kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2179 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (kn->active#32){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 kernfs_drain fs/kernfs/dir.c:478 [inline] __kernfs_remove+0x5da/0xcb0 fs/kernfs/dir.c:1372 kernfs_remove_by_name_ns+0x91/0x100 fs/kernfs/dir.c:1566 sysfs_remove_file include/linux/sysfs.h:613 [inline] device_remove_file drivers/base/core.c:2796 [inline] device_del+0x62f/0xa80 drivers/base/core.c:3613 device_unregister+0x1c/0xc0 drivers/base/core.c:3660 mce_device_remove arch/x86/kernel/cpu/mce/core.c:2575 [inline] mce_cpu_pre_down+0x33f/0x540 arch/x86/kernel/cpu/mce/core.c:2638 cpuhp_invoke_callback+0x423/0x7e0 kernel/cpu.c:191 cpuhp_thread_fun+0x3b2/0x7f0 kernel/cpu.c:822 smpboot_thread_fn+0x520/0x990 kernel/smpboot.c:164 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 other info that might help us debug this: Chain exists of: kn->active#32 --> cpu_hotplug_lock --> cpuhp_state-down Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(cpuhp_state-down); lock(cpu_hotplug_lock); lock(cpuhp_state-down); lock(kn->active#32); *** DEADLOCK *** 2 locks held by cpuhp/1/18: #0: ffffffff8cfbd670 (cpu_hotplug_lock){++++}-{0:0}, at: lockdep_acquire_cpus_lock+0x5/0x30 kernel/cpu.c:357 #1: ffffffff8cfbd7e0 (cpuhp_state-down){+.+.}-{0:0}, at: cpuhp_lock_acquire+0x8/0x40 kernel/cpu.c:99 stack backtrace: CPU: 1 PID: 18 Comm: cpuhp/1 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 kernfs_drain fs/kernfs/dir.c:478 [inline] __kernfs_remove+0x5da/0xcb0 fs/kernfs/dir.c:1372 kernfs_remove_by_name_ns+0x91/0x100 fs/kernfs/dir.c:1566 sysfs_remove_file include/linux/sysfs.h:613 [inline] device_remove_file drivers/base/core.c:2796 [inline] device_del+0x62f/0xa80 drivers/base/core.c:3613 device_unregister+0x1c/0xc0 drivers/base/core.c:3660 mce_device_remove arch/x86/kernel/cpu/mce/core.c:2575 [inline] mce_cpu_pre_down+0x33f/0x540 arch/x86/kernel/cpu/mce/core.c:2638 cpuhp_invoke_callback+0x423/0x7e0 kernel/cpu.c:191 cpuhp_thread_fun+0x3b2/0x7f0 kernel/cpu.c:822 smpboot_thread_fn+0x520/0x990 kernel/smpboot.c:164 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287