netlink: 32 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor.6'. ====================================================== WARNING: possible circular locking dependency detected 5.10.60 #1 Not tainted ------------------------------------------------------ syz-executor.6/45037 is trying to acquire lock: ffff888042104578 (&tty->read_wait){....}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff888042104578 (&tty->read_wait){....}-{2:2}, at: io_poll_double_wake+0x1f8/0x550 fs/io_uring.c:5068 but task is already holding lock: ffff888042104528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #6 (&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/0xac0 drivers/tty/serial/8250/8250_port.c:1850 serial8250_handle_irq.part.0+0x2d9/0x4d0 drivers/tty/serial/8250/8250_port.c:1937 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1910 [inline] serial8250_default_handle_irq+0xb8/0x230 drivers/tty/serial/8250/8250_port.c:1953 serial8250_interrupt+0xf4/0x1a0 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x2ef/0x820 kernel/irq/handle.c:156 handle_irq_event_percpu kernel/irq/handle.c:196 [inline] handle_irq_event+0x102/0x290 kernel/irq/handle.c:213 handle_edge_irq+0x249/0xd00 kernel/irq/chip.c:822 asm_call_irq_on_stack+0x12/0x20 __run_irq_on_irqstack arch/x86/include/asm/irq_stack.h:48 [inline] run_irq_on_irqstack_cond arch/x86/include/asm/irq_stack.h:101 [inline] handle_irq arch/x86/kernel/irq.c:230 [inline] __common_interrupt arch/x86/kernel/irq.c:249 [inline] common_interrupt+0xdd/0x190 arch/x86/kernel/irq.c:239 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:626 native_safe_halt arch/x86/include/asm/irqflags.h:60 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:103 [inline] default_idle+0xe/0x10 arch/x86/kernel/process.c:688 default_idle_call+0x87/0xd0 kernel/sched/idle.c:112 cpuidle_idle_call kernel/sched/idle.c:194 [inline] do_idle+0x3a5/0x510 kernel/sched/idle.c:300 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:396 secondary_startup_64_no_verify+0xc2/0xcb -> #5 (&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+0x8e2/0xb20 drivers/tty/serial/8250/8250_port.c:3323 call_console_drivers kernel/printk/printk.c:1909 [inline] console_unlock+0x823/0xb30 kernel/printk/printk.c:2523 register_console kernel/printk/printk.c:2864 [inline] register_console+0x523/0x800 kernel/printk/printk.c:2754 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:690 console_init+0x361/0x4fa kernel/printk/printk.c:2974 start_kernel+0x2ed/0x496 init/main.c:984 secondary_startup_64_no_verify+0xc2/0xcb -> #4 (console_owner){-.-.}-{0:0}: console_lock_spinning_enable kernel/printk/printk.c:1761 [inline] console_unlock+0x360/0xb30 kernel/printk/printk.c:2520 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+0x470/0x590 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:2814 [inline] slab_alloc mm/slub.c:2897 [inline] kmem_cache_alloc+0x5b/0x350 mm/slub.c:2902 radix_tree_node_alloc.constprop.0+0x1df/0x300 lib/radix-tree.c:251 idr_get_free+0x4b2/0x8e0 lib/radix-tree.c:1504 idr_alloc_u32+0x170/0x2d0 lib/idr.c:46 idr_alloc_cyclic+0x102/0x230 lib/idr.c:125 alloc_pid+0x4f7/0xd20 kernel/pid.c:233 copy_process+0x26c9/0x64e0 kernel/fork.c:2120 kernel_clone+0xe7/0xa20 kernel/fork.c:2465 __do_sys_clone3+0x1da/0x310 kernel/fork.c:2740 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #3 (pidmap_lock){....}-{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 free_pid+0x32/0x260 kernel/pid.c:132 __change_pid+0x1d3/0x2d0 kernel/pid.c:353 __unhash_process kernel/exit.c:77 [inline] __exit_signal kernel/exit.c:148 [inline] release_task+0xd83/0x1370 kernel/exit.c:199 exit_notify kernel/exit.c:685 [inline] do_exit+0x15a7/0x2770 kernel/exit.c:831 __module_put_and_exit+0x1b/0x20 kernel/module.c:348 cryptomgr_test+0x29/0x30 crypto/algboss.c:212 kthread+0x38f/0x470 kernel/kthread.c:292 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:296 -> #2 (&____s->seqcount#4){....}-{0:0}: seqcount_lockdep_reader_access include/linux/seqlock.h:103 [inline] read_seqbegin include/linux/seqlock.h:835 [inline] read_seqbegin_or_lock_irqsave include/linux/seqlock.h:1196 [inline] thread_group_cputime+0xf1/0x8c0 kernel/sched/cputime.c:317 thread_group_cputime_adjusted+0x72/0xf0 kernel/sched/cputime.c:629 do_task_stat+0x7c5/0x1c80 fs/proc/array.c:513 proc_single_show+0x121/0x1f0 fs/proc/base.c:775 seq_read_iter+0x50f/0x1240 fs/seq_file.c:230 seq_read+0x3cc/0x5a0 fs/seq_file.c:162 vfs_read+0x226/0x580 fs/read_write.c:494 ksys_read+0x12d/0x250 fs/read_write.c:634 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #1 (&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:2049 [inline] __io_async_wake+0x40b/0x8d0 fs/io_uring.c:4955 __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+0x207/0x6b0 drivers/tty/tty_ldisc.c:744 __tty_hangup.part.0+0x50d/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+0xfde/0x1600 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 -> #0 (&tty->read_wait){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:2985 [inline] check_prevs_add kernel/locking/lockdep.c:3110 [inline] validate_chain kernel/locking/lockdep.c:3725 [inline] __lock_acquire+0x29fd/0x5b60 kernel/locking/lockdep.c:4950 lock_acquire kernel/locking/lockdep.c:5560 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5525 __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:5068 __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+0x207/0x6b0 drivers/tty/tty_ldisc.c:744 __tty_hangup.part.0+0x50d/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+0xfde/0x1600 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 other info that might help us debug this: Chain exists of: &tty->read_wait --> &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(&tty->read_wait); *** DEADLOCK *** 2 locks held by syz-executor.6/45037: #0: ffff8880421041c0 (&tty->legacy_mutex){+.+.}-{3:3}, at: tty_lock+0xbd/0x120 drivers/tty/tty_mutex.c:19 #1: ffff888042104528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 stack backtrace: CPU: 1 PID: 45037 Comm: syz-executor.6 Not tainted 5.10.60 #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+0x268/0x310 kernel/locking/lockdep.c:2120 check_prev_add kernel/locking/lockdep.c:2985 [inline] check_prevs_add kernel/locking/lockdep.c:3110 [inline] validate_chain kernel/locking/lockdep.c:3725 [inline] __lock_acquire+0x29fd/0x5b60 kernel/locking/lockdep.c:4950 lock_acquire kernel/locking/lockdep.c:5560 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5525 __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:5068 __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+0x207/0x6b0 drivers/tty/tty_ldisc.c:744 __tty_hangup.part.0+0x50d/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+0xfde/0x1600 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 RIP: 0033:0x466609 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:00007f1615eab188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 0000000000466609 RDX: 0000000000000000 RSI: 0000000000005437 RDI: 0000000000000005 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007fff2ef2f08f R14: 00007f1615eab300 R15: 0000000000022000