RBP: 00007f25746c01d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffdf9b8811f R14: 00007f25746c0300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 5.10.105 #1 Not tainted ------------------------------------------------------ syz-executor.1/17268 is trying to acquire lock: ffffffff84d0afe0 (console_owner){-.-.}-{0:0}, at: console_unlock+0x2e1/0xb30 kernel/printk/printk.c:2505 but task is already holding lock: ffff8880446b6f18 (&sighand->siglock){-.-.}-{2:2}, at: __lock_task_sighand+0xd3/0x2f0 kernel/signal.c:1391 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&sighand->siglock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 __lock_task_sighand+0xd3/0x2f0 kernel/signal.c:1391 lock_task_sighand include/linux/sched/signal.h:693 [inline] task_work_add+0x1db/0x2b0 kernel/task_work.c:58 io_req_task_work_add fs/io_uring.c:2052 [inline] __io_async_wake+0x40b/0x8d0 fs/io_uring.c:4965 __wake_up_common+0x14c/0x4c0 kernel/sched/wait.c:93 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:123 tty_ldisc_lock+0x40/0xb0 drivers/tty/tty_ldisc.c:335 tty_ldisc_hangup+0x204/0x690 drivers/tty/tty_ldisc.c:744 __tty_hangup.part.0+0x510/0x9b0 drivers/tty/tty_io.c:624 __tty_hangup drivers/tty/tty_io.c:574 [inline] tty_vhangup drivers/tty/tty_io.c:697 [inline] tty_ioctl+0x120e/0x1830 drivers/tty/tty_io.c:2683 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #3 (&tty->read_wait){....}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x27/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] io_poll_double_wake+0x1f8/0x550 fs/io_uring.c:5078 __wake_up_common+0x14c/0x4c0 kernel/sched/wait.c:93 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:123 tty_ldisc_lock+0x55/0xb0 drivers/tty/tty_ldisc.c:336 tty_ldisc_hangup+0x204/0x690 drivers/tty/tty_ldisc.c:744 __tty_hangup.part.0+0x510/0x9b0 drivers/tty/tty_io.c:624 __tty_hangup drivers/tty/tty_io.c:574 [inline] tty_vhangup drivers/tty/tty_io.c:697 [inline] tty_ioctl+0x120e/0x1830 drivers/tty/tty_io.c:2683 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #2 (&tty->write_wait){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:50 serial8250_tx_chars+0x516/0xb40 drivers/tty/serial/8250/8250_port.c:1851 __start_tx drivers/tty/serial/8250/8250_port.c:1580 [inline] serial8250_start_tx+0x661/0xa20 drivers/tty/serial/8250/8250_port.c:1673 __uart_start.isra.0+0x173/0x1c0 drivers/tty/serial/serial_core.c:127 uart_write+0x2f2/0x580 drivers/tty/serial/serial_core.c:621 do_output_char+0x5e4/0x860 drivers/tty/n_tty.c:442 process_output drivers/tty/n_tty.c:509 [inline] n_tty_write+0x487/0xf90 drivers/tty/n_tty.c:2359 do_tty_write drivers/tty/tty_io.c:1028 [inline] file_tty_write.constprop.0+0x4f8/0x8d0 drivers/tty/tty_io.c:1118 redirected_tty_write+0xa1/0xc0 drivers/tty/tty_io.c:1125 call_write_iter include/linux/fs.h:1903 [inline] do_iter_readv_writev+0x476/0x750 fs/read_write.c:740 do_iter_write+0x18d/0x670 fs/read_write.c:866 vfs_writev+0x1aa/0x5e0 fs/read_write.c:939 do_writev+0x139/0x300 fs/read_write.c:982 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 serial8250_console_write+0x8dd/0xb20 drivers/tty/serial/8250/8250_port.c:3330 call_console_drivers kernel/printk/printk.c:1909 [inline] console_unlock+0x826/0xb30 kernel/printk/printk.c:2530 register_console kernel/printk/printk.c:2871 [inline] register_console+0x53d/0x800 kernel/printk/printk.c:2761 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:690 console_init+0x361/0x4fa kernel/printk/printk.c:2981 start_kernel+0x2f2/0x49b init/main.c:985 secondary_startup_64_no_verify+0xc2/0xcb -> #0 (console_owner){-.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:2986 [inline] check_prevs_add kernel/locking/lockdep.c:3111 [inline] validate_chain kernel/locking/lockdep.c:3726 [inline] __lock_acquire+0x29e3/0x5b00 kernel/locking/lockdep.c:4952 lock_acquire kernel/locking/lockdep.c:5562 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5527 console_lock_spinning_enable kernel/printk/printk.c:1761 [inline] console_unlock+0x360/0xb30 kernel/printk/printk.c:2527 vprintk_emit+0x1da/0x4d0 kernel/printk/printk.c:2052 vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 printk+0xba/0xed kernel/printk/printk.c:2100 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x472/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1193 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] slab_alloc mm/slub.c:2904 [inline] kmem_cache_alloc+0x5b/0x350 mm/slub.c:2909 __sigqueue_alloc+0x1ee/0x560 kernel/signal.c:435 __send_signal+0x5db/0x1040 kernel/signal.c:1116 do_send_sig_info kernel/signal.c:1291 [inline] group_send_sig_info+0x273/0x2d0 kernel/signal.c:1414 __kill_pgrp_info+0x88/0x120 kernel/signal.c:1432 kill_pgrp+0x3a/0x60 kernel/signal.c:1786 __isig drivers/tty/n_tty.c:1111 [inline] isig+0x10a/0x430 drivers/tty/n_tty.c:1128 n_tty_receive_signal_char+0x1f/0x150 drivers/tty/n_tty.c:1238 n_tty_receive_char_special+0x1273/0x2aa0 drivers/tty/n_tty.c:1290 n_tty_receive_buf_fast drivers/tty/n_tty.c:1605 [inline] __receive_buf drivers/tty/n_tty.c:1639 [inline] n_tty_receive_buf_common+0x1e57/0x2b70 drivers/tty/n_tty.c:1737 tty_ldisc_receive_buf+0xac/0x190 drivers/tty/tty_buffer.c:461 paste_selection+0x1e5/0x490 drivers/tty/vt/selection.c:408 tioclinux+0x48d/0x5a0 drivers/tty/vt/vt.c:3205 vt_ioctl+0x24ea/0x2f20 drivers/tty/vt/vt_ioctl.c:862 tty_ioctl+0x862/0x1830 drivers/tty/tty_io.c:2742 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Chain exists of: console_owner --> &tty->read_wait --> &sighand->siglock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sighand->siglock); lock(&tty->read_wait); lock(&sighand->siglock); lock(console_owner); *** DEADLOCK *** 7 locks held by syz-executor.1/17268: #0: ffff8880155b1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:266 #1: ffff888007c690b8 (&buf->lock){+.+.}-{3:3}, at: paste_selection+0x123/0x490 drivers/tty/vt/selection.c:390 #2: ffffffff850593e8 (vc_sel.lock){+.+.}-{3:3}, at: paste_selection+0x155/0x490 drivers/tty/vt/selection.c:393 #3: ffff8880155b12e8 (&tty->termios_rwsem){++++}-{3:3}, at: isig+0xe5/0x430 drivers/tty/n_tty.c:1126 #4: ffffffff84c0a098 (tasklist_lock){.+.+}-{2:2}, at: kill_pgrp+0x1e/0x60 kernel/signal.c:1785 #5: ffff8880446b6f18 (&sighand->siglock){-.-.}-{2:2}, at: __lock_task_sighand+0xd3/0x2f0 kernel/signal.c:1391 #6: ffffffff84deb360 (console_lock){+.+.}-{0:0}, at: vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 stack backtrace: CPU: 1 PID: 17268 Comm: syz-executor.1 Not tainted 5.10.105 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2121 check_prev_add kernel/locking/lockdep.c:2986 [inline] check_prevs_add kernel/locking/lockdep.c:3111 [inline] validate_chain kernel/locking/lockdep.c:3726 [inline] __lock_acquire+0x29e3/0x5b00 kernel/locking/lockdep.c:4952 lock_acquire kernel/locking/lockdep.c:5562 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5527 console_lock_spinning_enable kernel/printk/printk.c:1761 [inline] console_unlock+0x360/0xb30 kernel/printk/printk.c:2527 vprintk_emit+0x1da/0x4d0 kernel/printk/printk.c:2052 vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 printk+0xba/0xed kernel/printk/printk.c:2100 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x472/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1193 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] slab_alloc mm/slub.c:2904 [inline] kmem_cache_alloc+0x5b/0x350 mm/slub.c:2909 __sigqueue_alloc+0x1ee/0x560 kernel/signal.c:435 __send_signal+0x5db/0x1040 kernel/signal.c:1116 do_send_sig_info kernel/signal.c:1291 [inline] group_send_sig_info+0x273/0x2d0 kernel/signal.c:1414 __kill_pgrp_info+0x88/0x120 kernel/signal.c:1432 kill_pgrp+0x3a/0x60 kernel/signal.c:1786 __isig drivers/tty/n_tty.c:1111 [inline] isig+0x10a/0x430 drivers/tty/n_tty.c:1128 n_tty_receive_signal_char+0x1f/0x150 drivers/tty/n_tty.c:1238 n_tty_receive_char_special+0x1273/0x2aa0 drivers/tty/n_tty.c:1290 n_tty_receive_buf_fast drivers/tty/n_tty.c:1605 [inline] __receive_buf drivers/tty/n_tty.c:1639 [inline] n_tty_receive_buf_common+0x1e57/0x2b70 drivers/tty/n_tty.c:1737 tty_ldisc_receive_buf+0xac/0x190 drivers/tty/tty_buffer.c:461 paste_selection+0x1e5/0x490 drivers/tty/vt/selection.c:408 tioclinux+0x48d/0x5a0 drivers/tty/vt/vt.c:3205 vt_ioctl+0x24ea/0x2f20 drivers/tty/vt/vt_ioctl.c:862 tty_ioctl+0x862/0x1830 drivers/tty/tty_io.c:2742 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f257714ab19 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f25746c0188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f257725df60 RCX: 00007f257714ab19 RDX: 0000000020000000 RSI: 000000000000541c RDI: 0000000000000003 RBP: 00007f25746c01d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffdf9b8811f R14: 00007f25746c0300 R15: 0000000000022000