============================================ WARNING: possible recursive locking detected 6.9.0-syzkaller-08544-g4b377b4868ef #0 Not tainted -------------------------------------------- kworker/u32:2/40 is trying to acquire lock: ffff888043e331d8 (&qs->lock){..-.}-{2:2}, at: __queue_map_get+0x2b8/0x360 kernel/bpf/queue_stack_maps.c:105 but task is already holding lock: ffff88804dec61d8 (&qs->lock){..-.}-{2:2}, at: __queue_map_get+0x2b8/0x360 kernel/bpf/queue_stack_maps.c:105 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&qs->lock); lock(&qs->lock); *** DEADLOCK *** May be due to missing lock nesting notation 9 locks held by kworker/u32:2/40: #0: ffff888015491148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x12bf/0x1b60 kernel/workqueue.c:3206 #1: ffffc90000987d80 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work+0x957/0x1b60 kernel/workqueue.c:3207 #2: ffff888042ea40b8 (&port->buf.lock/1){+.+.}-{3:3}, at: flush_to_ldisc+0x31/0x780 drivers/tty/tty_buffer.c:467 #3: ffff8880463940a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x80 drivers/tty/tty_ldisc.c:263 #4: ffff8880463942e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: n_tty_receive_buf_common+0x85/0x1910 drivers/tty/n_tty.c:1692 #5: ffffc900008fe380 (&ldata->output_lock){+.+.}-{3:3}, at: commit_echoes+0x4c/0x210 drivers/tty/n_tty.c:756 #6: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #6: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #6: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #6: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2444 #7: ffff88804dec61d8 (&qs->lock){..-.}-{2:2}, at: __queue_map_get+0x2b8/0x360 kernel/bpf/queue_stack_maps.c:105 #8: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #8: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #8: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #8: ffffffff8dbb1760 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2444 stack backtrace: CPU: 3 PID: 40 Comm: kworker/u32:2 Not tainted 6.9.0-syzkaller-08544-g4b377b4868ef #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Workqueue: events_unbound flush_to_ldisc Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_deadlock kernel/locking/lockdep.c:3062 [inline] validate_chain kernel/locking/lockdep.c:3856 [inline] __lock_acquire+0x20e6/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 __queue_map_get+0x2b8/0x360 kernel/bpf/queue_stack_maps.c:105 ___bpf_prog_run+0x3e51/0xabd0 kernel/bpf/core.c:2012 __bpf_prog_run32+0xc1/0x100 kernel/bpf/core.c:2253 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run include/linux/filter.h:698 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline] bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2444 __bpf_trace_contention_begin+0xca/0x110 include/trace/events/lock.h:95 __traceiter_contention_begin+0x5a/0xa0 include/trace/events/lock.h:95 trace_contention_begin.constprop.0+0xed/0x170 include/trace/events/lock.h:95 __pv_queued_spin_lock_slowpath+0x112/0xcc0 kernel/locking/qspinlock.c:402 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline] queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline] queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x210/0x2c0 kernel/locking/spinlock_debug.c:116 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 __queue_map_get+0x2b8/0x360 kernel/bpf/queue_stack_maps.c:105 ___bpf_prog_run+0x3e51/0xabd0 kernel/bpf/core.c:2012 __bpf_prog_run32+0xc1/0x100 kernel/bpf/core.c:2253 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run include/linux/filter.h:698 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline] bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2444 __bpf_trace_contention_begin+0xca/0x110 include/trace/events/lock.h:95 __traceiter_contention_begin+0x5a/0xa0 include/trace/events/lock.h:95 trace_contention_begin+0xce/0x140 include/trace/events/lock.h:95 __mutex_lock_common kernel/locking/mutex.c:610 [inline] __mutex_lock+0x182/0x9c0 kernel/locking/mutex.c:752 commit_echoes+0x4c/0x210 drivers/tty/n_tty.c:756 n_tty_receive_char+0x3d8/0x600 drivers/tty/n_tty.c:1437 n_tty_receive_buf_standard+0x6aa/0x3180 drivers/tty/n_tty.c:1606 __receive_buf drivers/tty/n_tty.c:1630 [inline] n_tty_receive_buf_common+0x8ec/0x1910 drivers/tty/n_tty.c:1729 tty_ldisc_receive_buf+0xa2/0x190 drivers/tty/tty_buffer.c:387 tty_port_default_receive_buf+0x70/0xb0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x264/0x780 drivers/tty/tty_buffer.c:495 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244