============================================
WARNING: possible recursive locking detected
5.19.0-rc7-syzkaller-00139-g4ba1329cbb94 #0 Not tainted
--------------------------------------------
sshd/3600 is trying to acquire lock:
ffffffff8be0dfb8 (trace_printk_lock){....}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
ffffffff8be0dfb8 (trace_printk_lock){....}-{2:2}, at: bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
but task is already holding lock:
ffffffff8be0dfb8 (trace_printk_lock){....}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
ffffffff8be0dfb8 (trace_printk_lock){....}-{2:2}, at: bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(trace_printk_lock);
lock(trace_printk_lock);
*** DEADLOCK ***
May be due to missing lock nesting notation
4 locks held by sshd/3600:
#0: ffff888021c1c868 (&pipe->mutex/1){+.+.}-{3:3}, at: __pipe_lock fs/pipe.c:103 [inline]
#0: ffff888021c1c868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_read+0x139/0x1100 fs/pipe.c:244
#1: ffffffff8bd87120 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x0/0x340 kernel/trace/./bpf_trace.h:11
#2: ffffffff8be0dfb8 (trace_printk_lock){....}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
#2: ffffffff8be0dfb8 (trace_printk_lock){....}-{2:2}, at: bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
#3: ffffffff8bd87120 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x0/0x340 kernel/trace/./bpf_trace.h:11
stack backtrace:
CPU: 1 PID: 3600 Comm: sshd Not tainted 5.19.0-rc7-syzkaller-00139-g4ba1329cbb94 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2988 [inline]
check_deadlock kernel/locking/lockdep.c:3031 [inline]
validate_chain kernel/locking/lockdep.c:3816 [inline]
__lock_acquire.cold+0x1f5/0x3b4 kernel/locking/lockdep.c:5053
lock_acquire kernel/locking/lockdep.c:5665 [inline]
lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
bpf_prog_0605f9f479290f07+0x2f/0x33
bpf_dispatcher_nop_func include/linux/bpf.h:869 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2046 [inline]
bpf_trace_run2+0x110/0x340 kernel/trace/bpf_trace.c:2083
__bpf_trace_contention_begin+0xb5/0xf0 include/trace/events/lock.h:95
trace_contention_begin.constprop.0+0xda/0x1b0 include/trace/events/lock.h:95
__pv_queued_spin_lock_slowpath+0x103/0xb50 kernel/locking/qspinlock.c:405
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [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+0x200/0x2a0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0x41/0x50 kernel/locking/spinlock.c:162
____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
bpf_prog_0605f9f479290f07+0x2f/0x33
bpf_dispatcher_nop_func include/linux/bpf.h:869 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2046 [inline]
bpf_trace_run2+0x110/0x340 kernel/trace/bpf_trace.c:2083
__bpf_trace_contention_begin+0xb5/0xf0 include/trace/events/lock.h:95
trace_contention_begin+0xc0/0x150 include/trace/events/lock.h:95
__mutex_lock_common kernel/locking/mutex.c:605 [inline]
__mutex_lock+0x13c/0x1350 kernel/locking/mutex.c:747
__pipe_lock fs/pipe.c:103 [inline]
pipe_read+0x139/0x1100 fs/pipe.c:244
call_read_iter include/linux/fs.h:2052 [inline]
new_sync_read+0x4f9/0x5f0 fs/read_write.c:401
vfs_read+0x492/0x5d0 fs/read_write.c:482
ksys_read+0x1e8/0x250 fs/read_write.c:620
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+0x63/0xcd
RIP: 0033:0x7f56d4a7c8fe
Code: c0 e9 e6 fe ff ff 50 48 8d 3d 0e c7 09 00 e8 c9 cf 01 00 66 0f 1f 84 00 00 00 00 00 64 8b 04 25 18 00 00 00 85 c0 75 14 0f 05 <48> 3d 00 f0 ff ff 77 5a c3 66 0f 1f 84 00 00 00 00 00 48 83 ec 28
RSP: 002b:00007fffca428bf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f56d4a7c8fe
RDX: 0000000000004000 RSI: 00007fffca428c08 RDI: 0000000000000009
RBP: 000055e938bcc3d0 R08: 000055e938bbb710 R09: 00007fffca50b080
R10: 00007fffca50b0f0 R11: 0000000000000246 R12: 0000000000000027
R13: 000055e938bcafb0 R14: 00007fffca428c08 R15: 000055e938bc5e70
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3600 at kernel/bpf/helpers.c:791 try_get_fmt_tmp_buf kernel/bpf/helpers.c:791 [inline]
WARNING: CPU: 1 PID: 3600 at kernel/bpf/helpers.c:791 bpf_bprintf_prepare+0xf31/0x11a0 kernel/bpf/helpers.c:839
Modules linked in:
CPU: 1 PID: 3600 Comm: sshd Not tainted 5.19.0-rc7-syzkaller-00139-g4ba1329cbb94 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
RIP: 0010:try_get_fmt_tmp_buf kernel/bpf/helpers.c:791 [inline]
RIP: 0010:bpf_bprintf_prepare+0xf31/0x11a0 kernel/bpf/helpers.c:839
Code: ff e8 b3 02 eb ff 48 83 7c 24 08 00 41 bd 04 00 00 00 0f 85 8a fa ff ff e8 9c 02 eb ff 8d 6b 03 e9 f7 f6 ff ff e8 8f 02 eb ff <0f> 0b 65 ff 0d ee d6 73 7e bf 01 00 00 00 41 bc f0 ff ff ff e8 d6
RSP: 0018:ffffc900032ceb08 EFLAGS: 00010093
RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000
RDX: ffff888025e09d80 RSI: ffffffff818f6a11 RDI: 0000000000000005
RBP: ffffc900032cec38 R08: 0000000000000005 R09: 0000000000000003
R10: 0000000000000004 R11: 0000000000000001 R12: 0000000000000003
R13: 0000000000000004 R14: ffffc900032cecf0 R15: 0000000000000003
FS: 00007f56d4e98800(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb73540c150 CR3: 0000000070855000 CR4: 0000000000350ee0
Call Trace:
____bpf_trace_printk kernel/trace/bpf_trace.c:383 [inline]
bpf_trace_printk+0xab/0x170 kernel/trace/bpf_trace.c:374
bpf_prog_0605f9f479290f07+0x2f/0x33
bpf_dispatcher_nop_func include/linux/bpf.h:869 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2046 [inline]
bpf_trace_run2+0x110/0x340 kernel/trace/bpf_trace.c:2083
__bpf_trace_contention_begin+0xb5/0xf0 include/trace/events/lock.h:95
trace_contention_begin.constprop.0+0xda/0x1b0 include/trace/events/lock.h:95
__pv_queued_spin_lock_slowpath+0x103/0xb50 kernel/locking/qspinlock.c:405
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [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+0x200/0x2a0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0x41/0x50 kernel/locking/spinlock.c:162
____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
bpf_prog_0605f9f479290f07+0x2f/0x33
bpf_dispatcher_nop_func include/linux/bpf.h:869 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2046 [inline]
bpf_trace_run2+0x110/0x340 kernel/trace/bpf_trace.c:2083
__bpf_trace_contention_begin+0xb5/0xf0 include/trace/events/lock.h:95
trace_contention_begin.constprop.0+0xda/0x1b0 include/trace/events/lock.h:95
__pv_queued_spin_lock_slowpath+0x103/0xb50 kernel/locking/qspinlock.c:405
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [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+0x200/0x2a0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0x41/0x50 kernel/locking/spinlock.c:162
____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
bpf_prog_0605f9f479290f07+0x2f/0x33
bpf_dispatcher_nop_func include/linux/bpf.h:869 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2046 [inline]
bpf_trace_run2+0x110/0x340 kernel/trace/bpf_trace.c:2083
__bpf_trace_contention_begin+0xb5/0xf0 include/trace/events/lock.h:95
trace_contention_begin.constprop.0+0xda/0x1b0 include/trace/events/lock.h:95
__pv_queued_spin_lock_slowpath+0x103/0xb50 kernel/locking/qspinlock.c:405
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [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+0x200/0x2a0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0x41/0x50 kernel/locking/spinlock.c:162
____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
bpf_prog_0605f9f479290f07+0x2f/0x33
bpf_dispatcher_nop_func include/linux/bpf.h:869 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2046 [inline]
bpf_trace_run2+0x110/0x340 kernel/trace/bpf_trace.c:2083
__bpf_trace_contention_begin+0xb5/0xf0 include/trace/events/lock.h:95
trace_contention_begin+0xc0/0x150 include/trace/events/lock.h:95
__mutex_lock_common kernel/locking/mutex.c:605 [inline]
__mutex_lock+0x13c/0x1350 kernel/locking/mutex.c:747
__pipe_lock fs/pipe.c:103 [inline]
pipe_read+0x139/0x1100 fs/pipe.c:244
call_read_iter include/linux/fs.h:2052 [inline]
new_sync_read+0x4f9/0x5f0 fs/read_write.c:401
vfs_read+0x492/0x5d0 fs/read_write.c:482
ksys_read+0x1e8/0x250 fs/read_write.c:620
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+0x63/0xcd
RIP: 0033:0x7f56d4a7c8fe
Code: c0 e9 e6 fe ff ff 50 48 8d 3d 0e c7 09 00 e8 c9 cf 01 00 66 0f 1f 84 00 00 00 00 00 64 8b 04 25 18 00 00 00 85 c0 75 14 0f 05 <48> 3d 00 f0 ff ff 77 5a c3 66 0f 1f 84 00 00 00 00 00 48 83 ec 28
RSP: 002b:00007fffca428bf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f56d4a7c8fe
RDX: 0000000000004000 RSI: 00007fffca428c08 RDI: 0000000000000009
RBP: 000055e938bcc3d0 R08: 000055e938bbb710 R09: 00007fffca50b080
R10: 00007fffca50b0f0 R11: 0000000000000246 R12: 0000000000000028
R13: 000055e938bcafb0 R14: 00007fffca428c08 R15: 000055e938bc5e70