====================================================== WARNING: possible circular locking dependency detected 5.17.0-rc5-next-20220222 #1 Not tainted ------------------------------------------------------ kworker/0:8/888 is trying to acquire lock: ffff88806ce37418 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x39f/0x10a0 kernel/workqueue.c:1474 but task is already holding lock: ffff88803b4dc528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&tty->write_wait){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51 serial8250_tx_chars+0x50b/0xb00 drivers/tty/serial/8250/8250_port.c:1853 serial8250_handle_irq.part.0+0x3f1/0x4c0 drivers/tty/serial/8250/8250_port.c:1940 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1913 [inline] serial8250_default_handle_irq+0xb8/0x230 drivers/tty/serial/8250/8250_port.c:1957 serial8250_interrupt+0xf4/0x1a0 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x20f/0x820 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xa7/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x262/0xd10 kernel/irq/chip.c:817 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:231 [inline] __common_interrupt+0x92/0x1d0 arch/x86/kernel/irq.c:250 common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0x2e/0x50 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] uart_write+0x304/0x580 drivers/tty/serial/serial_core.c:587 do_output_char+0x5e4/0x860 drivers/tty/n_tty.c:435 process_output drivers/tty/n_tty.c:501 [inline] n_tty_write+0x4c9/0xfe0 drivers/tty/n_tty.c:2260 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write.constprop.0+0x529/0x910 drivers/tty/tty_io.c:1095 redirected_tty_write+0xa1/0xc0 drivers/tty/tty_io.c:1116 call_write_iter include/linux/fs.h:2095 [inline] do_iter_readv_writev+0x481/0x760 fs/read_write.c:726 do_iter_write+0x18d/0x700 fs/read_write.c:852 vfs_writev+0x1aa/0x630 fs/read_write.c:925 do_writev+0x139/0x300 fs/read_write.c:968 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #2 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 serial8250_console_write+0x90e/0xb20 drivers/tty/serial/8250/8250_port.c:3359 call_console_drivers kernel/printk/printk.c:1953 [inline] console_unlock+0x8c7/0xd40 kernel/printk/printk.c:2775 register_console kernel/printk/printk.c:3122 [inline] register_console+0x378/0x7d0 kernel/printk/printk.c:3013 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:679 console_init+0x3c1/0x58d kernel/printk/printk.c:3232 start_kernel+0x301/0x4aa init/main.c:1068 secondary_startup_64_no_verify+0xd5/0xdb -> #1 (console_owner){-.-.}-{0:0}: console_lock_spinning_enable kernel/printk/printk.c:1795 [inline] console_unlock+0x3a1/0xd40 kernel/printk/printk.c:2772 vprintk_emit+0x1b4/0x550 kernel/printk/printk.c:2273 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2294 warn_flush_attempt kernel/workqueue.c:2613 [inline] check_flush_dependency.cold+0x18/0x4e kernel/workqueue.c:2635 start_flush_work kernel/workqueue.c:3049 [inline] __flush_work+0x246/0xae0 kernel/workqueue.c:3091 __cancel_work_timer+0x398/0x4d0 kernel/workqueue.c:3179 disk_block_events+0x102/0x130 block/disk-events.c:93 blkdev_get_by_dev+0xe4/0xcb0 block/bdev.c:805 blkdev_open+0x154/0x2e0 block/fops.c:498 do_dentry_open+0x4b7/0x1110 fs/open.c:957 do_open fs/namei.c:3476 [inline] path_openat+0x1a3e/0x28a0 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4d0 fs/open.c:1347 do_sys_open fs/open.c:1363 [inline] __do_sys_openat fs/open.c:1379 [inline] __se_sys_openat fs/open.c:1374 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1374 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (&pool->lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3096 [inline] check_prevs_add kernel/locking/lockdep.c:3219 [inline] validate_chain kernel/locking/lockdep.c:3834 [inline] __lock_acquire+0x2c2f/0x6120 kernel/locking/lockdep.c:5060 lock_acquire kernel/locking/lockdep.c:5672 [inline] lock_acquire+0x1a2/0x4d0 kernel/locking/lockdep.c:5637 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 __queue_work+0x39f/0x10a0 kernel/workqueue.c:1474 queue_work_on+0xae/0xc0 kernel/workqueue.c:1545 queue_work include/linux/workqueue.h:514 [inline] schedule_work include/linux/workqueue.h:575 [inline] p9_pollwake+0xb9/0x170 net/9p/trans_fd.c:534 __wake_up_common+0x14c/0x4c0 kernel/sched/wait.c:108 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:138 tty_write_unlock drivers/tty/tty_io.c:945 [inline] do_tty_write drivers/tty/tty_io.c:1049 [inline] file_tty_write.constprop.0+0x62f/0x910 drivers/tty/tty_io.c:1095 __kernel_write+0x59e/0xb40 fs/read_write.c:536 kernel_write fs/read_write.c:565 [inline] kernel_write+0xe2/0x550 fs/read_write.c:555 p9_fd_write net/9p/trans_fd.c:428 [inline] p9_write_work+0x25a/0xc30 net/9p/trans_fd.c:479 process_one_work+0xa1c/0x16a0 kernel/workqueue.c:2289 worker_thread+0x637/0x1250 kernel/workqueue.c:2436 kthread+0x2f0/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 other info that might help us debug this: Chain exists of: &pool->lock --> &port_lock_key --> &tty->write_wait Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tty->write_wait); lock(&port_lock_key); lock(&tty->write_wait); lock(&pool->lock); *** DEADLOCK *** 5 locks held by kworker/0:8/888: #0: ffff888007858d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888007858d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888007858d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888007858d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline] #0: ffff888007858d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline] #0: ffff888007858d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x915/0x16a0 kernel/workqueue.c:2260 #1: ffff8880382ffdb0 ((work_completion)(&m->wq)){+.+.}-{0:0}, at: process_one_work+0x949/0x16a0 kernel/workqueue.c:2264 #2: ffff88803b4dc098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244 #3: ffff88803b4dc528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137 #4: ffffffff85202f00 (rcu_read_lock){....}-{1:2}, at: __queue_work+0xd0/0x10a0 kernel/workqueue.c:1437 stack backtrace: CPU: 0 PID: 888 Comm: kworker/0:8 Not tainted 5.17.0-rc5-next-20220222 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: events p9_write_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2176 check_prev_add kernel/locking/lockdep.c:3096 [inline] check_prevs_add kernel/locking/lockdep.c:3219 [inline] validate_chain kernel/locking/lockdep.c:3834 [inline] __lock_acquire+0x2c2f/0x6120 kernel/locking/lockdep.c:5060 lock_acquire kernel/locking/lockdep.c:5672 [inline] lock_acquire+0x1a2/0x4d0 kernel/locking/lockdep.c:5637 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 __queue_work+0x39f/0x10a0 kernel/workqueue.c:1474 queue_work_on+0xae/0xc0 kernel/workqueue.c:1545 queue_work include/linux/workqueue.h:514 [inline] schedule_work include/linux/workqueue.h:575 [inline] p9_pollwake+0xb9/0x170 net/9p/trans_fd.c:534 __wake_up_common+0x14c/0x4c0 kernel/sched/wait.c:108 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:138 tty_write_unlock drivers/tty/tty_io.c:945 [inline] do_tty_write drivers/tty/tty_io.c:1049 [inline] file_tty_write.constprop.0+0x62f/0x910 drivers/tty/tty_io.c:1095 __kernel_write+0x59e/0xb40 fs/read_write.c:536 kernel_write fs/read_write.c:565 [inline] kernel_write+0xe2/0x550 fs/read_write.c:555 p9_fd_write net/9p/trans_fd.c:428 [inline] p9_write_work+0x25a/0xc30 net/9p/trans_fd.c:479 process_one_work+0xa1c/0x16a0 kernel/workqueue.c:2289 worker_thread+0x637/0x1250 kernel/workqueue.c:2436 kthread+0x2f0/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.0'. 9pnet_fd: p9_fd_create_tcp (276862): problem connecting socket to 127.0.0.1 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.0'. 9pnet_fd: p9_fd_create_tcp (276972): problem connecting socket to 127.0.0.1 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.0'. tmpfs: Bad value for 'nr_blocks' tmpfs: Bad value for 'nr_blocks' 9pnet_fd: p9_fd_create_tcp (277032): problem connecting socket to 127.0.0.1 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.0'. 9pnet_fd: p9_fd_create_tcp (277108): problem connecting socket to 127.0.0.1 netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. kernel write not supported for file [eventfd] (pid: 131216 comm: kworker/1:0) kernel write not supported for file [eventfd] (pid: 131216 comm: kworker/1:0) kernel write not supported for file [eventfd] (pid: 131216 comm: kworker/1:0) kernel write not supported for file [eventfd] (pid: 131216 comm: kworker/1:0) kernel write not supported for file [eventfd] (pid: 131216 comm: kworker/1:0) kernel write not supported for file [eventfd] (pid: 131216 comm: kworker/1:0) kernel write not supported for file [eventfd] (pid: 888 comm: kworker/0:8) netlink: 'syz-executor.7': attribute type 1 has an invalid length. EXT4-fs warning (device sda): verify_group_input:136: Cannot add at group 0 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:136: Cannot add at group 0 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:136: Cannot add at group 0 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:136: Cannot add at group 0 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:136: Cannot add at group 0 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:136: Cannot add at group 0 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:136: Cannot add at group 7 (only 16 groups) device lo left promiscuous mode