------------[ cut here ]------------
======================================================
WARNING: possible circular locking dependency detected
6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Not tainted
------------------------------------------------------
kworker/1:1/45 is trying to acquire lock:
ffffffff8dac31a0 (console_owner){-.-.}-{0:0}, at: console_lock_spinning_enable kernel/printk/printk.c:1870 [inline]
ffffffff8dac31a0 (console_owner){-.-.}-{0:0}, at: console_emit_next_record kernel/printk/printk.c:2922 [inline]
ffffffff8dac31a0 (console_owner){-.-.}-{0:0}, at: console_flush_all+0x4ff/0xd70 kernel/printk/printk.c:2994
but task is already holding lock:
ffff8880b933db58 (&pool->lock){-.-.}-{2:2}, at: start_flush_work kernel/workqueue.c:4129 [inline]
ffff8880b933db58 (&pool->lock){-.-.}-{2:2}, at: __flush_work+0x14a/0xc60 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+0x2e/0x40 kernel/locking/spinlock.c:154
__queue_work+0x39e/0x1020 kernel/workqueue.c:2319
queue_work_on+0x11a/0x140 kernel/workqueue.c:2410
queue_work include/linux/workqueue.h:621 [inline]
rpm_suspend+0xe69/0x1200 drivers/base/power/runtime.c:662
rpm_idle+0x5bf/0x740 drivers/base/power/runtime.c:536
__pm_runtime_idle+0xbc/0x160 drivers/base/power/runtime.c:1104
pm_runtime_put include/linux/pm_runtime.h:448 [inline]
__device_attach+0x382/0x4b0 drivers/base/dd.c:1046
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532
device_add+0x114b/0x1a70 drivers/base/core.c:3721
serial_base_port_add+0x357/0x4b0 drivers/tty/serial/serial_base_bus.c:179
serial_core_port_device_add drivers/tty/serial/serial_core.c:3380 [inline]
serial_core_register_port+0x13d/0x2050 drivers/tty/serial/serial_core.c:3421
serial8250_register_8250_port+0x1410/0x2090 drivers/tty/serial/8250/8250_core.c:1140
serial_pnp_probe+0x44f/0x930 drivers/tty/serial/8250/8250_pnp.c:490
pnp_device_probe+0x2a8/0x4d0 drivers/pnp/driver.c:111
call_driver_probe drivers/base/dd.c:578 [inline]
really_probe+0x241/0xa90 drivers/base/dd.c:656
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:798
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828
__driver_attach+0x283/0x580 drivers/base/dd.c:1214
bus_for_each_dev+0x13f/0x1d0 drivers/base/bus.c:368
bus_add_driver+0x2e9/0x690 drivers/base/bus.c:673
driver_register+0x15c/0x4b0 drivers/base/driver.c:246
serial8250_init+0xbe/0x4c0 drivers/tty/serial/8250/8250_core.c:1241
do_one_initcall+0x12b/0x700 init/main.c:1267
do_initcall_level init/main.c:1329 [inline]
do_initcalls init/main.c:1345 [inline]
do_basic_setup init/main.c:1364 [inline]
kernel_init_freeable+0x69d/0xca0 init/main.c:1578
kernel_init+0x1c/0x2b0 init/main.c:1467
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
-> #2 (&dev->power.lock){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
__pm_runtime_resume+0xa9/0x170 drivers/base/power/runtime.c:1171
pm_runtime_get include/linux/pm_runtime.h:396 [inline]
__uart_start+0x1b0/0x4c0 drivers/tty/serial/serial_core.c:148
uart_write+0x191/0x3e0 drivers/tty/serial/serial_core.c:633
process_output_block drivers/tty/n_tty.c:574 [inline]
n_tty_write+0x426/0x1150 drivers/tty/n_tty.c:2379
iterate_tty_write drivers/tty/tty_io.c:1021 [inline]
file_tty_write.constprop.0+0x51b/0x9b0 drivers/tty/tty_io.c:1096
tty_write drivers/tty/tty_io.c:1117 [inline]
redirected_tty_write drivers/tty/tty_io.c:1140 [inline]
redirected_tty_write+0xce/0x140 drivers/tty/tty_io.c:1120
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0x6b9/0x1140 fs/read_write.c:590
ksys_write+0x12f/0x260 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #1 (&port_lock_key){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
uart_port_lock_irqsave include/linux/serial_core.h:618 [inline]
serial8250_console_write+0xaa6/0x1090 drivers/tty/serial/8250/8250_port.c:3352
console_emit_next_record kernel/printk/printk.c:2928 [inline]
console_flush_all+0x53f/0xd70 kernel/printk/printk.c:2994
console_unlock+0xae/0x290 kernel/printk/printk.c:3063
vprintk_emit kernel/printk/printk.c:2345 [inline]
vprintk_emit+0x11a/0x5a0 kernel/printk/printk.c:2300
vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2370
register_console+0xa88/0x10a0 kernel/printk/printk.c:3596
univ8250_console_init+0x35/0x50 drivers/tty/serial/8250/8250_core.c:719
console_init+0xcc/0x680 kernel/printk/printk.c:3742
start_kernel+0x295/0x4c0 init/main.c:1038
x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:507
x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:488
common_startup_64+0x13e/0x148
-> #0 (console_owner){-.-.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719
console_lock_spinning_enable kernel/printk/printk.c:1870 [inline]
console_emit_next_record kernel/printk/printk.c:2922 [inline]
console_flush_all+0x514/0xd70 kernel/printk/printk.c:2994
console_unlock+0xae/0x290 kernel/printk/printk.c:3063
vprintk_emit kernel/printk/printk.c:2345 [inline]
vprintk_emit+0x11a/0x5a0 kernel/printk/printk.c:2300
vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2370
__warn_printk+0x158/0x350 kernel/panic.c:737
check_flush_dependency+0x3a5/0x450 kernel/workqueue.c:3706
start_flush_work kernel/workqueue.c:4143 [inline]
__flush_work+0x21e/0xc60 kernel/workqueue.c:4181
hfs_file_fsync+0x107/0x1a0 fs/hfs/inode.c:678
vfs_fsync_range+0x144/0x230 fs/sync.c:188
generic_write_sync include/linux/fs.h:2794 [inline]
dio_complete+0x728/0x8f0 fs/direct-io.c:314
process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393
kthread+0x2c4/0x3a0 kernel/kthread.c:389
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
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/1:1/45:
#0: ffff88802e633d48 ((wq_completion)dio/loop3){+.+.}-{0:0}, at: process_one_work+0x12bf/0x1b60 kernel/workqueue.c:3206
#1: ffffc90000b57d80 ((work_completion)(&dio->complete_work)){+.+.}-{0:0}, at: process_one_work+0x957/0x1b60 kernel/workqueue.c:3207
#2: ffff88806529e428 (&sb->s_type->i_mutex_key#35){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline]
#2: ffff88806529e428 (&sb->s_type->i_mutex_key#35){+.+.}-{3:3}, at: hfs_file_fsync+0xa3/0x1a0 fs/hfs/inode.c:671
#3: ffffffff8dbb5be0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#3: ffffffff8dbb5be0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#3: ffffffff8dbb5be0 (rcu_read_lock){....}-{1:2}, at: start_flush_work kernel/workqueue.c:4122 [inline]
#3: ffffffff8dbb5be0 (rcu_read_lock){....}-{1:2}, at: __flush_work+0x103/0xc60 kernel/workqueue.c:4181
#4: ffff8880b933db58 (&pool->lock){-.-.}-{2:2}, at: start_flush_work kernel/workqueue.c:4129 [inline]
#4: ffff8880b933db58 (&pool->lock){-.-.}-{2:2}, at: __flush_work+0x14a/0xc60 kernel/workqueue.c:4181
#5: ffffffff8dba35e0 (console_lock){+.+.}-{0:0}, at: vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
#6: ffffffff8dba3650 (console_srcu){....}-{0:0}, at: rcu_try_lock_acquire include/linux/rcupdate.h:334 [inline]
#6: ffffffff8dba3650 (console_srcu){....}-{0:0}, at: srcu_read_lock_nmisafe include/linux/srcu.h:232 [inline]
#6: ffffffff8dba3650 (console_srcu){....}-{0:0}, at: console_srcu_read_lock kernel/printk/printk.c:286 [inline]
#6: ffffffff8dba3650 (console_srcu){....}-{0:0}, at: console_flush_all+0x12d/0xd70 kernel/printk/printk.c:2986
stack backtrace:
CPU: 1 PID: 45 Comm: kworker/1:1 Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Workqueue: dio/loop3 dio_aio_complete_work
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114
check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719
console_lock_spinning_enable kernel/printk/printk.c:1870 [inline]
console_emit_next_record kernel/printk/printk.c:2922 [inline]
console_flush_all+0x514/0xd70 kernel/printk/printk.c:2994
console_unlock+0xae/0x290 kernel/printk/printk.c:3063
vprintk_emit kernel/printk/printk.c:2345 [inline]
vprintk_emit+0x11a/0x5a0 kernel/printk/printk.c:2300
vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2370
__warn_printk+0x158/0x350 kernel/panic.c:737
check_flush_dependency+0x3a5/0x450 kernel/workqueue.c:3706
start_flush_work kernel/workqueue.c:4143 [inline]
__flush_work+0x21e/0xc60 kernel/workqueue.c:4181
hfs_file_fsync+0x107/0x1a0 fs/hfs/inode.c:678
vfs_fsync_range+0x144/0x230 fs/sync.c:188
generic_write_sync include/linux/fs.h:2794 [inline]
dio_complete+0x728/0x8f0 fs/direct-io.c:314
process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393
kthread+0x2c4/0x3a0 kernel/kthread.c:389
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
workqueue: WQ_MEM_RECLAIM dio/loop3:dio_aio_complete_work is flushing !WQ_MEM_RECLAIM events_long:flush_mdb
WARNING: CPU: 1 PID: 45 at kernel/workqueue.c:3706 check_flush_dependency+0x3a6/0x450 kernel/workqueue.c:3706
Modules linked in:
CPU: 1 PID: 45 Comm: kworker/1:1 Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Workqueue: dio/loop3 dio_aio_complete_work
RIP: 0010:check_flush_dependency+0x3a6/0x450 kernel/workqueue.c:3706
Code: fa 48 c1 ea 03 80 3c 02 00 0f 85 b2 00 00 00 49 8b 55 18 49 8d b6 70 01 00 00 4d 89 e0 48 c7 c7 a0 ba 2b 8b e8 4b 2b f8 ff 90 <0f> 0b 90 90 e9 db fc ff ff e8 cc 8f 92 00 e9 bb fc ff ff e8 c2 8f
RSP: 0018:ffffc90000b57a18 EFLAGS: 00010082
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff81514a39
RDX: ffff88801be85a00 RSI: ffffffff81514a46 RDI: 0000000000000001
RBP: ffff888015479000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 6f72665f74657220 R12: ffffffff82709d10
R13: ffff88801aebf300 R14: ffff88802e633c00 R15: ffff888015491408
FS: 0000000000000000(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000007e53a000 CR4: 0000000000350ef0
Call Trace:
start_flush_work kernel/workqueue.c:4143 [inline]
__flush_work+0x21e/0xc60 kernel/workqueue.c:4181
hfs_file_fsync+0x107/0x1a0 fs/hfs/inode.c:678
vfs_fsync_range+0x144/0x230 fs/sync.c:188
generic_write_sync include/linux/fs.h:2794 [inline]
dio_complete+0x728/0x8f0 fs/direct-io.c:314
process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393
kthread+0x2c4/0x3a0 kernel/kthread.c:389
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244