loop5: detected capacity change from 0 to 164 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.5.211/5573 is trying to acquire lock: ffff88807b6a8a18 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0x5c/0x1080 kernel/sched/core.c:4111 but task is already holding lock: ffff88802722f528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline] ffff88802722f528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up+0xf4/0x190 kernel/sched/wait.c:160 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&tty->write_wait){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xf4/0x190 kernel/sched/wait.c:160 tty_port_default_wakeup+0x9e/0xf0 drivers/tty/tty_port.c:71 serial8250_tx_chars+0x629/0x830 drivers/tty/serial/8250/8250_port.c:1854 serial8250_handle_irq+0x516/0x6d0 drivers/tty/serial/8250/8250_port.c:1961 serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1981 serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x298/0xa30 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x87/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:233 [inline] __common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252 common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:682 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xa5/0x100 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] uart_write+0x68a/0x910 drivers/tty/serial/serial_core.c:602 process_output_block drivers/tty/n_tty.c:586 [inline] n_tty_write+0xd1a/0x11c0 drivers/tty/n_tty.c:2377 do_tty_write drivers/tty/tty_io.c:1018 [inline] file_tty_write+0x4dd/0x860 drivers/tty/tty_io.c:1089 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x44c/0x960 fs/read_write.c:584 ksys_write+0x143/0x240 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #3 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 serial8250_console_write+0x169/0x17a0 drivers/tty/serial/8250/8250_port.c:3432 call_console_driver kernel/printk/printk.c:1977 [inline] console_emit_next_record+0x947/0xc90 kernel/printk/printk.c:2777 console_flush_all kernel/printk/printk.c:-1 [inline] console_unlock+0x223/0x630 kernel/printk/printk.c:2906 vprintk_emit+0x489/0x680 kernel/printk/printk.c:2303 _printk+0xcc/0x110 kernel/printk/printk.c:2328 register_console+0x6c6/0x9c0 kernel/printk/printk.c:3269 univ8250_console_init+0x41/0x43 drivers/tty/serial/8250/8250_core.c:687 console_init+0x1bc/0x78e kernel/printk/printk.c:3359 start_kernel+0x303/0x539 init/main.c:1076 secondary_startup_64_no_verify+0xcf/0xdb -> #2 (console_owner){-...}-{0:0}: console_lock_spinning_enable kernel/printk/printk.c:1818 [inline] console_emit_next_record+0x84c/0xc90 kernel/printk/printk.c:2774 console_flush_all kernel/printk/printk.c:-1 [inline] console_unlock+0x223/0x630 kernel/printk/printk.c:2906 vprintk_emit+0x489/0x680 kernel/printk/printk.c:2303 _printk+0xcc/0x110 kernel/printk/printk.c:2328 fail_dump lib/fault-inject.c:45 [inline] should_fail_ex+0x37a/0x4d0 lib/fault-inject.c:147 strncpy_from_user+0x32/0x350 lib/strncpy_from_user.c:118 strncpy_from_user_nofault+0x6d/0x140 mm/maccess.c:186 bpf_trace_copy_string kernel/bpf/helpers.c:746 [inline] bpf_bprintf_prepare+0xba0/0x13d0 kernel/bpf/helpers.c:971 ____bpf_trace_printk kernel/trace/bpf_trace.c:384 [inline] bpf_trace_printk+0xd8/0x190 kernel/trace/bpf_trace.c:374 0xffffffffa0000991 bpf_dispatcher_nop_func include/linux/bpf.h:1011 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 trace_contention_begin+0x142/0x190 include/trace/events/lock.h:95 __pv_queued_spin_lock_slowpath+0xdc/0x9c0 kernel/locking/qspinlock.c:405 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1355 [inline] rq_lock kernel/sched/sched.h:1645 [inline] __schedule+0x2ed/0x40b0 kernel/sched/core.c:6477 preempt_schedule_irq+0xb1/0x150 kernel/sched/core.c:6873 irqentry_exit+0x63/0x70 kernel/entry/common.c:439 asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:696 kasan_quarantine_reduce+0xe/0x160 mm/kasan/quarantine.c:252 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737 slab_alloc_node mm/slub.c:3359 [inline] kmem_cache_alloc_node+0x14d/0x320 mm/slub.c:3404 __alloc_skb+0xfc/0x7e0 net/core/skbuff.c:505 alloc_skb include/linux/skbuff.h:1271 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline] netlink_sendmsg+0x645/0xbc0 net/netlink/af_netlink.c:1847 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] ____sys_sendmsg+0x59b/0x970 net/socket.c:2519 ___sys_sendmsg+0x21c/0x290 net/socket.c:2573 __sys_sendmsg net/socket.c:2602 [inline] __do_sys_sendmsg net/socket.c:2611 [inline] __se_sys_sendmsg+0x19e/0x270 net/socket.c:2609 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&rq->__lock){-.-.}-{2:2}: _raw_spin_lock_nested+0x2e/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1355 [inline] rq_lock kernel/sched/sched.h:1645 [inline] task_fork_fair+0x5c/0x350 kernel/sched/fair.c:11901 sched_cgroup_fork+0x32c/0x3c0 kernel/sched/core.c:4685 copy_process+0x24b8/0x4020 kernel/fork.c:2459 kernel_clone+0x225/0x8b0 kernel/fork.c:2757 user_mode_thread+0xda/0x130 kernel/fork.c:2833 rest_init+0x23/0x300 init/main.c:698 start_kernel+0x0/0x539 init/main.c:893 start_kernel+0x490/0x539 init/main.c:1140 secondary_startup_64_no_verify+0xcf/0xdb -> #0 (&p->pi_lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 try_to_wake_up+0x5c/0x1080 kernel/sched/core.c:4111 __set_notify_signal include/linux/sched/signal.h:368 [inline] set_notify_signal include/linux/sched/signal.h:377 [inline] task_work_add+0x26b/0x330 kernel/task_work.c:64 __io_req_task_work_add+0x2fb/0x620 io_uring/io_uring.c:1155 io_poll_wake+0x370/0x460 io_uring/poll.c:467 __wake_up_common+0x2a4/0x4e0 kernel/sched/wait.c:107 __wake_up_common_lock kernel/sched/wait.c:138 [inline] __wake_up+0x10e/0x190 kernel/sched/wait.c:160 n_hdlc_send_frames+0x519/0xa30 drivers/tty/n_hdlc.c:307 n_hdlc_tty_write+0x711/0x870 drivers/tty/n_hdlc.c:568 do_tty_write drivers/tty/tty_io.c:1018 [inline] file_tty_write+0x4dd/0x860 drivers/tty/tty_io.c:1089 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x44c/0x960 fs/read_write.c:584 ksys_write+0x143/0x240 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &p->pi_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(&p->pi_lock); *** DEADLOCK *** 3 locks held by syz.5.211/5573: #0: ffff88802722f098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:244 #1: ffff88802722f130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:944 [inline] #1: ffff88802722f130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:967 [inline] #1: ffff88802722f130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write+0x1eb/0x860 drivers/tty/tty_io.c:1089 #2: ffff88802722f528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline] #2: ffff88802722f528 (&tty->write_wait){-.-.}-{2:2}, at: __wake_up+0xf4/0x190 kernel/sched/wait.c:160 stack backtrace: CPU: 1 PID: 5573 Comm: syz.5.211 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 try_to_wake_up+0x5c/0x1080 kernel/sched/core.c:4111 __set_notify_signal include/linux/sched/signal.h:368 [inline] set_notify_signal include/linux/sched/signal.h:377 [inline] task_work_add+0x26b/0x330 kernel/task_work.c:64 __io_req_task_work_add+0x2fb/0x620 io_uring/io_uring.c:1155 io_poll_wake+0x370/0x460 io_uring/poll.c:467 __wake_up_common+0x2a4/0x4e0 kernel/sched/wait.c:107 __wake_up_common_lock kernel/sched/wait.c:138 [inline] __wake_up+0x10e/0x190 kernel/sched/wait.c:160 n_hdlc_send_frames+0x519/0xa30 drivers/tty/n_hdlc.c:307 n_hdlc_tty_write+0x711/0x870 drivers/tty/n_hdlc.c:568 do_tty_write drivers/tty/tty_io.c:1018 [inline] file_tty_write+0x4dd/0x860 drivers/tty/tty_io.c:1089 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x44c/0x960 fs/read_write.c:584 ksys_write+0x143/0x240 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fae2218eba9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fae23048038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fae223d5fa0 RCX: 00007fae2218eba9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007fae22211e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fae223d6038 R14: 00007fae223d5fa0 R15: 00007ffee5746c68