====================================================== WARNING: possible circular locking dependency detected 5.17.0-rc5-next-20220222-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/3780 is trying to acquire lock: ffff8880b9c395d8 (&pool->lock ){-.-.}-{2:2}, at: __queue_work+0x366/0x1140 kernel/workqueue.c:1474 but task is already holding lock: ffffffff9061a530 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1916 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #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+0x91a/0xb70 drivers/tty/serial/8250/8250_port.c:3359 call_console_drivers kernel/printk/printk.c:1953 [inline] console_unlock+0x9bc/0xdd0 kernel/printk/printk.c:2775 vprintk_emit+0x1b4/0x5f0 kernel/printk/printk.c:2273 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2294 register_console kernel/printk/printk.c:3132 [inline] register_console+0x410/0x7c0 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+0x30b/0x4a0 init/main.c:1068 secondary_startup_64_no_verify+0xc3/0xcb -> #1 (console_owner){....}-{0:0}: console_lock_spinning_enable kernel/printk/printk.c:1795 [inline] console_unlock+0x3b1/0xdd0 kernel/printk/printk.c:2772 vprintk_emit+0x1b4/0x5f0 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+0x25a/0xb10 kernel/workqueue.c:3091 flush_all_cpus_locked+0x148/0x1b0 mm/slub.c:2728 flush_all mm/slub.c:2737 [inline] __kmem_cache_shrink+0x11/0x20 mm/slub.c:4640 acpi_os_purge_cache+0x11/0x20 drivers/acpi/osl.c:1666 acpi_purge_cached_objects+0x37/0xd0 drivers/acpi/acpica/utxface.c:237 acpi_initialize_objects+0x2b/0x95 drivers/acpi/acpica/utxfinit.c:250 acpi_bus_init drivers/acpi/bus.c:1237 [inline] acpi_init+0x1d2/0x976 drivers/acpi/bus.c:1325 do_one_initcall+0x103/0x650 init/main.c:1302 do_initcall_level init/main.c:1375 [inline] do_initcalls init/main.c:1391 [inline] do_basic_setup init/main.c:1410 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1615 kernel_init+0x1a/0x1d0 init/main.c:1504 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #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+0x2ac6/0x56c0 kernel/locking/lockdep.c:5060 lock_acquire kernel/locking/lockdep.c:5672 [inline] lock_acquire+0x1ab/0x510 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+0x366/0x1140 kernel/workqueue.c:1474 queue_work_on+0xee/0x110 kernel/workqueue.c:1545 tty_wakeup+0xe1/0x120 drivers/tty/tty_io.c:530 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51 serial8250_tx_chars+0x4f3/0xad0 drivers/tty/serial/8250/8250_port.c:1853 serial8250_handle_irq.part.0+0x328/0x3d0 drivers/tty/serial/8250/8250_port.c:1940 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1913 [inline] serial8250_default_handle_irq+0xb2/0x220 drivers/tty/serial/8250/8250_port.c:1957 serial8250_interrupt+0xfd/0x200 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x22b/0x880 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+0x25f/0xd00 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+0x9d/0x210 arch/x86/kernel/irq.c:250 common_interrupt+0xa4/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+0x38/0x70 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] uart_write+0x30d/0x570 drivers/tty/serial/serial_core.c:587 n_hdlc_send_frames+0x24b/0x490 drivers/tty/n_hdlc.c:297 n_hdlc_tty_write+0x55c/0x650 drivers/tty/n_hdlc.c:586 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write.constprop.0+0x526/0x910 drivers/tty/tty_io.c:1095 call_write_iter include/linux/fs.h:2095 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:726 do_iter_write+0x188/0x710 fs/read_write.c:852 vfs_iter_write+0x70/0xa0 fs/read_write.c:893 iter_file_splice_write+0x723/0xc70 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xaf2/0x1250 fs/read_write.c:1246 __do_sys_sendfile64 fs/read_write.c:1311 [inline] __se_sys_sendfile64 fs/read_write.c:1297 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1297 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: &pool->lock --> console_owner --> &port_lock_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&port_lock_key); lock(console_owner); lock(&port_lock_key); lock(&pool->lock); *** DEADLOCK *** 6 locks held by syz-executor.1/3780: #0: ffff888022fde098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244 #1: ffff888022fde130 (&tty->atomic_write_lock ){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:950 [inline] ){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:973 [inline] ){+.+.}-{3:3}, at: file_tty_write.constprop.0+0x29f/0x910 drivers/tty/tty_io.c:1095 #2: ffff8880787634b0 (&i->lock ){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116 #3: ffffffff9061a530 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1916 #4: ffff888022fde098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:264 #5: ffffffff8bb866a0 (rcu_read_lock){....}-{1:2} , at: __queue_work+0xd0/0x1140 kernel/workqueue.c:1437 stack backtrace: CPU: 0 PID: 3780 Comm: syz-executor.1 Not tainted 5.17.0-rc5-next-20220222-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 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+0x2ac6/0x56c0 kernel/locking/lockdep.c:5060 lock_acquire kernel/locking/lockdep.c:5672 [inline] lock_acquire+0x1ab/0x510 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+0x366/0x1140 kernel/workqueue.c:1474 queue_work_on+0xee/0x110 kernel/workqueue.c:1545 tty_wakeup+0xe1/0x120 drivers/tty/tty_io.c:530 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51 serial8250_tx_chars+0x4f3/0xad0 drivers/tty/serial/8250/8250_port.c:1853 serial8250_handle_irq.part.0+0x328/0x3d0 drivers/tty/serial/8250/8250_port.c:1940 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1913 [inline] serial8250_default_handle_irq+0xb2/0x220 drivers/tty/serial/8250/8250_port.c:1957 serial8250_interrupt+0xfd/0x200 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x22b/0x880 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+0x25f/0xd00 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+0x9d/0x210 arch/x86/kernel/irq.c:250 common_interrupt+0xa4/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194 Code: 74 24 10 e8 da c9 0b f8 48 89 ef e8 22 49 0c f8 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 83 e2 fe f7 65 8b 05 cc 6e b0 76 85 c0 74 0a 5b 5d c3 e8 b0 76 RSP: 0018:ffffc90004b6f520 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff1fc7966 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffffffff9061a518 R08: 0000000000000001 R09: ffffffff8fdfea27 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000 R13: ffff8880776140eb R14: 0000000000000f28 R15: 0000000000000000 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] uart_write+0x30d/0x570 drivers/tty/serial/serial_core.c:587 n_hdlc_send_frames+0x24b/0x490 drivers/tty/n_hdlc.c:297 n_hdlc_tty_write+0x55c/0x650 drivers/tty/n_hdlc.c:586 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write.constprop.0+0x526/0x910 drivers/tty/tty_io.c:1095 call_write_iter include/linux/fs.h:2095 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:726 do_iter_write+0x188/0x710 fs/read_write.c:852 vfs_iter_write+0x70/0xa0 fs/read_write.c:893 iter_file_splice_write+0x723/0xc70 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xaf2/0x1250 fs/read_write.c:1246 __do_sys_sendfile64 fs/read_write.c:1311 [inline] __se_sys_sendfile64 fs/read_write.c:1297 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1297 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f1b0ec89059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1b0d5fe168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f1b0ed9bf60 RCX: 00007f1b0ec89059 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 00007f1b0ece308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000020000000005 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff7427b32f R14: 00007f1b0d5fe300 R15: 0000000000022000 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 15 at kernel/fork.c:466 free_task+0xe6/0x110 kernel/fork.c:466 Modules linked in: CPU: 0 PID: 15 Comm: ksoftirqd/0 Not tainted 5.17.0-rc5-next-20220222-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:free_task+0xe6/0x110 kernel/fork.c:466 Code: 23 34 00 48 89 ee 5b 48 8b 3d b6 b4 ba 0d 5d 41 5c e9 1e 95 7b 00 e8 39 23 34 00 48 89 ef e8 c1 bc 09 00 eb d9 e8 2a 23 34 00 <0f> 0b e9 78 ff ff ff e8 9e cc 7b 00 eb b0 4c 89 e7 e8 94 cc 7b 00 RSP: 0018:ffffc90000147d10 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000100 RDX: ffff888010e73a00 RSI: ffffffff81450ea6 RDI: 0000000000000003 RBP: ffff888047710000 R08: 0000000000000000 R09: ffff888047711713 R10: ffffffff81450e21 R11: 0000000000000000 R12: ffff888047711710 R13: ffff888047710028 R14: 0000000000000007 R15: ffff888047711510 FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0129409c70 CR3: 00000000715a4000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: put_task_struct include/linux/sched/task.h:115 [inline] delayed_put_task_struct+0x1f6/0x340 kernel/exit.c:174 rcu_do_batch kernel/rcu/tree.c:2561 [inline] rcu_core+0x7b1/0x1880 kernel/rcu/tree.c:2812 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 run_ksoftirqd kernel/softirq.c:921 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 ---------------- Code disassembly (best guess): 0: 74 24 je 0x26 2: 10 e8 adc %ch,%al 4: da c9 fcmove %st(1),%st 6: 0b f8 or %eax,%edi 8: 48 89 ef mov %rbp,%rdi b: e8 22 49 0c f8 callq 0xf80c4932 10: 81 e3 00 02 00 00 and $0x200,%ebx 16: 75 25 jne 0x3d 18: 9c pushfq 19: 58 pop %rax 1a: f6 c4 02 test $0x2,%ah 1d: 75 2d jne 0x4c 1f: 48 85 db test %rbx,%rbx 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 83 e2 fe f7 callq 0xf7fee2b2 <-- trapping instruction 2f: 65 8b 05 cc 6e b0 76 mov %gs:0x76b06ecc(%rip),%eax # 0x76b06f02 36: 85 c0 test %eax,%eax 38: 74 0a je 0x44 3a: 5b pop %rbx 3b: 5d pop %rbp 3c: c3 retq 3d: e8 .byte 0xe8 3e: b0 76 mov $0x76,%al