------------[ cut here ]------------ ====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc7-syzkaller-g887407160d72 #0 Not tainted ------------------------------------------------------ kworker/0:0/8 is trying to acquire lock: ffff80008f8ccb00 (console_owner){..-.}-{0:0}, at: console_lock_spinning_enable+0x88/0xec kernel/printk/printk.c:1901 but task is already holding lock: ffff0001b364b098 (&pool->lock){-.-.}-{2:2}, at: start_flush_work kernel/workqueue.c:4130 [inline] ffff0001b364b098 (&pool->lock){-.-.}-{2:2}, at: __flush_work+0x178/0x954 kernel/workqueue.c:4181 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&pool->lock){-.-.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x48/0x60 kernel/locking/spinlock.c:154 __queue_work+0x8b0/0x1308 queue_work_on+0xe0/0x1a0 kernel/workqueue.c:2390 queue_work include/linux/workqueue.h:662 [inline] rpm_suspend+0xc20/0x1470 drivers/base/power/runtime.c:662 rpm_idle+0x570/0x8c0 drivers/base/power/runtime.c:536 __pm_runtime_idle+0x114/0x1d4 drivers/base/power/runtime.c:1104 pm_runtime_put include/linux/pm_runtime.h:448 [inline] __device_attach+0x34c/0x434 drivers/base/dd.c:1048 device_initial_probe+0x24/0x34 drivers/base/dd.c:1079 bus_probe_device+0x178/0x240 drivers/base/bus.c:534 device_add+0x728/0xa6c drivers/base/core.c:3672 serial_base_port_add+0x25c/0x370 drivers/tty/serial/serial_base_bus.c:179 serial_core_port_device_add drivers/tty/serial/serial_core.c:3370 [inline] serial_core_register_port+0x300/0x2118 drivers/tty/serial/serial_core.c:3411 serial_ctrl_register_port+0x28/0x38 drivers/tty/serial/serial_ctrl.c:41 uart_add_one_port+0x28/0x38 drivers/tty/serial/serial_port.c:143 pl011_register_port+0x1b4/0x44c drivers/tty/serial/amba-pl011.c:2744 sbsa_uart_probe+0x488/0x608 drivers/tty/serial/amba-pl011.c:2914 platform_probe+0x148/0x1c0 drivers/base/platform.c:1404 really_probe+0x38c/0x8fc drivers/base/dd.c:658 __driver_probe_device+0x194/0x374 drivers/base/dd.c:800 driver_probe_device+0x78/0x330 drivers/base/dd.c:830 __device_attach_driver+0x2a8/0x4f4 drivers/base/dd.c:958 bus_for_each_drv+0x228/0x2bc drivers/base/bus.c:459 __device_attach+0x2b4/0x434 drivers/base/dd.c:1030 device_initial_probe+0x24/0x34 drivers/base/dd.c:1079 bus_probe_device+0x178/0x240 drivers/base/bus.c:534 device_add+0x728/0xa6c drivers/base/core.c:3672 platform_device_add+0x3e8/0x6e8 drivers/base/platform.c:716 platform_device_register_full+0x4f0/0x608 drivers/base/platform.c:844 acpi_create_platform_device+0x5bc/0x744 drivers/acpi/acpi_platform.c:177 acpi_default_enumeration+0x6c/0xdc drivers/acpi/scan.c:2213 acpi_bus_attach+0x804/0xad4 drivers/acpi/scan.c:2324 acpi_dev_for_one_check+0xa0/0xb4 drivers/acpi/bus.c:1145 device_for_each_child+0xf0/0x180 drivers/base/core.c:4001 acpi_dev_for_each_child+0xc4/0x108 drivers/acpi/bus.c:1157 acpi_bus_attach+0x868/0xad4 drivers/acpi/scan.c:2329 acpi_dev_for_one_check+0xa0/0xb4 drivers/acpi/bus.c:1145 device_for_each_child+0xf0/0x180 drivers/base/core.c:4001 acpi_dev_for_each_child+0xc4/0x108 drivers/acpi/bus.c:1157 acpi_bus_attach+0x868/0xad4 drivers/acpi/scan.c:2329 acpi_bus_scan+0x118/0x4f0 drivers/acpi/scan.c:2610 acpi_scan_init+0x214/0x6b0 drivers/acpi/scan.c:2747 acpi_init+0x190/0x254 drivers/acpi/bus.c:1466 do_one_initcall+0x24c/0x9c0 init/main.c:1269 do_initcall_level+0x154/0x214 init/main.c:1331 do_initcalls+0x58/0xac init/main.c:1347 do_basic_setup+0x8c/0xa0 init/main.c:1366 kernel_init_freeable+0x324/0x478 init/main.c:1580 kernel_init+0x24/0x2a0 init/main.c:1469 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 -> #2 (&dev->power.lock){-...}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x5c/0x7c kernel/locking/spinlock.c:162 __pm_runtime_resume+0xf0/0x180 drivers/base/power/runtime.c:1171 pm_runtime_get include/linux/pm_runtime.h:396 [inline] __uart_start+0x154/0x3d8 drivers/tty/serial/serial_core.c:148 uart_write+0x270/0x9b4 drivers/tty/serial/serial_core.c:635 process_output_block drivers/tty/n_tty.c:574 [inline] n_tty_write+0xaec/0xed0 drivers/tty/n_tty.c:2389 iterate_tty_write drivers/tty/tty_io.c:1015 [inline] file_tty_write+0x410/0x7b8 drivers/tty/tty_io.c:1090 tty_write drivers/tty/tty_io.c:1111 [inline] redirected_tty_write+0xa8/0x144 drivers/tty/tty_io.c:1134 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x920/0xcf4 fs/read_write.c:683 ksys_write+0x15c/0x26c fs/read_write.c:736 __do_sys_write fs/read_write.c:748 [inline] __se_sys_write fs/read_write.c:745 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:745 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 -> #1 (&port_lock_key){..-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x5c/0x7c kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:711 [inline] pl011_console_write+0x158/0xdc0 drivers/tty/serial/amba-pl011.c:2316 console_emit_next_record kernel/printk/printk.c:3092 [inline] console_flush_all+0x604/0xb90 kernel/printk/printk.c:3180 __console_flush_and_unlock kernel/printk/printk.c:3239 [inline] console_unlock+0x138/0x3ac kernel/printk/printk.c:3279 vprintk_emit+0x308/0x55c kernel/printk/printk.c:2407 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2422 vprintk+0x200/0x300 kernel/printk/printk_safe.c:68 _printk+0xdc/0x128 kernel/printk/printk.c:2432 register_console+0x8f0/0xcc0 kernel/printk/printk.c:4069 uart_configure_port drivers/tty/serial/serial_core.c:2655 [inline] serial_core_add_one_port drivers/tty/serial/serial_core.c:3182 [inline] serial_core_register_port+0x1688/0x2118 drivers/tty/serial/serial_core.c:3419 serial_ctrl_register_port+0x28/0x38 drivers/tty/serial/serial_ctrl.c:41 uart_add_one_port+0x28/0x38 drivers/tty/serial/serial_port.c:143 pl011_register_port+0x1b4/0x44c drivers/tty/serial/amba-pl011.c:2744 sbsa_uart_probe+0x488/0x608 drivers/tty/serial/amba-pl011.c:2914 platform_probe+0x148/0x1c0 drivers/base/platform.c:1404 really_probe+0x38c/0x8fc drivers/base/dd.c:658 __driver_probe_device+0x194/0x374 drivers/base/dd.c:800 driver_probe_device+0x78/0x330 drivers/base/dd.c:830 __device_attach_driver+0x2a8/0x4f4 drivers/base/dd.c:958 bus_for_each_drv+0x228/0x2bc drivers/base/bus.c:459 __device_attach+0x2b4/0x434 drivers/base/dd.c:1030 device_initial_probe+0x24/0x34 drivers/base/dd.c:1079 bus_probe_device+0x178/0x240 drivers/base/bus.c:534 device_add+0x728/0xa6c drivers/base/core.c:3672 platform_device_add+0x3e8/0x6e8 drivers/base/platform.c:716 platform_device_register_full+0x4f0/0x608 drivers/base/platform.c:844 acpi_create_platform_device+0x5bc/0x744 drivers/acpi/acpi_platform.c:177 acpi_default_enumeration+0x6c/0xdc drivers/acpi/scan.c:2213 acpi_bus_attach+0x804/0xad4 drivers/acpi/scan.c:2324 acpi_dev_for_one_check+0xa0/0xb4 drivers/acpi/bus.c:1145 device_for_each_child+0xf0/0x180 drivers/base/core.c:4001 acpi_dev_for_each_child+0xc4/0x108 drivers/acpi/bus.c:1157 acpi_bus_attach+0x868/0xad4 drivers/acpi/scan.c:2329 acpi_dev_for_one_check+0xa0/0xb4 drivers/acpi/bus.c:1145 device_for_each_child+0xf0/0x180 drivers/base/core.c:4001 acpi_dev_for_each_child+0xc4/0x108 drivers/acpi/bus.c:1157 acpi_bus_attach+0x868/0xad4 drivers/acpi/scan.c:2329 acpi_bus_scan+0x118/0x4f0 drivers/acpi/scan.c:2610 acpi_scan_init+0x214/0x6b0 drivers/acpi/scan.c:2747 acpi_init+0x190/0x254 drivers/acpi/bus.c:1466 do_one_initcall+0x24c/0x9c0 init/main.c:1269 do_initcall_level+0x154/0x214 init/main.c:1331 do_initcalls+0x58/0xac init/main.c:1347 do_basic_setup+0x8c/0xa0 init/main.c:1366 kernel_init_freeable+0x324/0x478 init/main.c:1580 kernel_init+0x24/0x2a0 init/main.c:1469 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 -> #0 (console_owner){..-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 console_lock_spinning_enable+0xb4/0xec kernel/printk/printk.c:1905 console_emit_next_record kernel/printk/printk.c:3086 [inline] console_flush_all+0x5c4/0xb90 kernel/printk/printk.c:3180 __console_flush_and_unlock kernel/printk/printk.c:3239 [inline] console_unlock+0x138/0x3ac kernel/printk/printk.c:3279 vprintk_emit+0x308/0x55c kernel/printk/printk.c:2407 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2422 vprintk+0x200/0x300 kernel/printk/printk_safe.c:68 _printk+0xdc/0x128 kernel/printk/printk.c:2432 __warn_printk+0x27c/0x484 kernel/panic.c:794 check_flush_dependency+0x27c/0x330 kernel/workqueue.c:3704 start_flush_work kernel/workqueue.c:4144 [inline] __flush_work+0x21c/0x954 kernel/workqueue.c:4181 flush_work kernel/workqueue.c:4238 [inline] flush_delayed_work+0xcc/0xf8 kernel/workqueue.c:4260 hfs_file_fsync+0xec/0x148 fs/hfs/inode.c:680 vfs_fsync_range+0x160/0x19c fs/sync.c:188 generic_write_sync include/linux/fs.h:2871 [inline] dio_complete+0x4f0/0x660 fs/direct-io.c:313 dio_aio_complete_work+0x28/0x38 fs/direct-io.c:325 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 other info that might help us debug this: Chain exists of: console_owner --> &dev->power.lock --> &pool->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pool->lock); lock(&dev->power.lock); lock(&pool->lock); lock(console_owner); *** DEADLOCK *** 7 locks held by kworker/0:0/8: #0: ffff0000cd498d48 ((wq_completion)dio/loop8){+.+.}-{0:0}, at: process_one_work+0x628/0x1600 kernel/workqueue.c:3203 #1: ffff8000978a7c20 ((work_completion)(&dio->complete_work)){+.+.}-{0:0}, at: process_one_work+0x6bc/0x1600 kernel/workqueue.c:3203 #2: ffff0000eb751620 (&sb->s_type->i_mutex_key#37){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #2: ffff0000eb751620 (&sb->s_type->i_mutex_key#37){+.+.}-{3:3}, at: hfs_file_fsync+0xa0/0x148 fs/hfs/inode.c:673 #3: ffff80008f9efee0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:336 #4: ffff0001b364b098 (&pool->lock){-.-.}-{2:2}, at: start_flush_work kernel/workqueue.c:4130 [inline] #4: ffff0001b364b098 (&pool->lock){-.-.}-{2:2}, at: __flush_work+0x178/0x954 kernel/workqueue.c:4181 #5: ffff80008f8ccb60 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0x2ec/0x55c kernel/printk/printk.c:2406 #6: ffff80008f8cc770 (console_srcu){....}-{0:0}, at: rcu_try_lock_acquire+0x10/0x4c include/linux/rcupdate.h:341 stack backtrace: CPU: 0 UID: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.12.0-rc7-syzkaller-g887407160d72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: dio/loop8 dio_aio_complete_work Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x154/0x1c0 kernel/locking/lockdep.c:2074 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 console_lock_spinning_enable+0xb4/0xec kernel/printk/printk.c:1905 console_emit_next_record kernel/printk/printk.c:3086 [inline] console_flush_all+0x5c4/0xb90 kernel/printk/printk.c:3180 __console_flush_and_unlock kernel/printk/printk.c:3239 [inline] console_unlock+0x138/0x3ac kernel/printk/printk.c:3279 vprintk_emit+0x308/0x55c kernel/printk/printk.c:2407 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2422 vprintk+0x200/0x300 kernel/printk/printk_safe.c:68 _printk+0xdc/0x128 kernel/printk/printk.c:2432 __warn_printk+0x27c/0x484 kernel/panic.c:794 check_flush_dependency+0x27c/0x330 kernel/workqueue.c:3704 start_flush_work kernel/workqueue.c:4144 [inline] __flush_work+0x21c/0x954 kernel/workqueue.c:4181 flush_work kernel/workqueue.c:4238 [inline] flush_delayed_work+0xcc/0xf8 kernel/workqueue.c:4260 hfs_file_fsync+0xec/0x148 fs/hfs/inode.c:680 vfs_fsync_range+0x160/0x19c fs/sync.c:188 generic_write_sync include/linux/fs.h:2871 [inline] dio_complete+0x4f0/0x660 fs/direct-io.c:313 dio_aio_complete_work+0x28/0x38 fs/direct-io.c:325 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 workqueue: WQ_MEM_RECLAIM dio/loop8:dio_aio_complete_work is flushing !WQ_MEM_RECLAIM events_long:flush_mdb WARNING: CPU: 0 PID: 8 at kernel/workqueue.c:3708 check_flush_dependency+0x27c/0x330 kernel/workqueue.c:3704 Modules linked in: CPU: 0 UID: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.12.0-rc7-syzkaller-g887407160d72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: dio/loop8 dio_aio_complete_work pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : check_flush_dependency+0x27c/0x330 kernel/workqueue.c:3704 lr : check_flush_dependency+0x27c/0x330 kernel/workqueue.c:3704 sp : ffff8000978a7790 x29: ffff8000978a7790 x28: 0000000000000000 x27: 1fffe0001e13bc2b x26: 0000000000000000 x25: ffff800092aa3000 x24: ffff0000cd498c00 x23: dfff800000000000 x22: ffff0000c1a0b618 x21: ffff0000cd498d78 x20: ffff80008125fba0 x19: ffff0000c0029000 x18: 0000000000000008 x17: 0000000000000000 x16: ffff8000830ce3b0 x15: 0000000000000001 x14: 1fffe000366c6ce2 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000003 x10: 0000000000ff0100 x9 : 856f020595048d00 x8 : 856f020595048d00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000978a6eb8 x4 : ffff80008f8fd220 x3 : ffff800080626cb0 x2 : 0000000000000001 x1 : 0000000100000001 x0 : 0000000000000000 Call trace: check_flush_dependency+0x27c/0x330 kernel/workqueue.c:3704 (P) check_flush_dependency+0x27c/0x330 kernel/workqueue.c:3704 (L) start_flush_work kernel/workqueue.c:4144 [inline] __flush_work+0x21c/0x954 kernel/workqueue.c:4181 flush_work kernel/workqueue.c:4238 [inline] flush_delayed_work+0xcc/0xf8 kernel/workqueue.c:4260 hfs_file_fsync+0xec/0x148 fs/hfs/inode.c:680 vfs_fsync_range+0x160/0x19c fs/sync.c:188 generic_write_sync include/linux/fs.h:2871 [inline] dio_complete+0x4f0/0x660 fs/direct-io.c:313 dio_aio_complete_work+0x28/0x38 fs/direct-io.c:325 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 irq event stamp: 299248 hardirqs last enabled at (299247): [] flush_delayed_work+0xac/0xf8 kernel/workqueue.c:4259 hardirqs last disabled at (299248): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (299248): [] _raw_spin_lock_irq+0x28/0x70 kernel/locking/spinlock.c:170 softirqs last enabled at (299220): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (299220): [] ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline] softirqs last enabled at (299220): [] wg_packet_encrypt_worker+0x10a4/0x1134 drivers/net/wireguard/send.c:293 softirqs last disabled at (299218): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (299218): [] ptr_ring_consume_bh include/linux/ptr_ring.h:365 [inline] softirqs last disabled at (299218): [] wg_packet_encrypt_worker+0xe5c/0x1134 drivers/net/wireguard/send.c:293 ---[ end trace 0000000000000000 ]---