============================================
WARNING: possible recursive locking detected
5.19.0-rc4-next-20220628-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.5/27321 is trying to acquire lock:
ffffffff8be0e2d8 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
ffffffff8be0e2d8 (trace_printk_lock){-.-.}-{2:2}, at: bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
but task is already holding lock:
ffffffff8be0e2d8 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
ffffffff8be0e2d8 (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 syz-executor.5/27321:
#0: ffffffff8cf554c8 (videodev_lock){+.+.}-{3:3}, at: v4l2_open+0x20/0x3f0 drivers/media/v4l2-core/v4l2-dev.c:415
#1: ffffffff8bd87040 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x0/0x340 kernel/trace/./bpf_trace.h:11
#2: ffffffff8be0e2d8 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:388 [inline]
#2: ffffffff8be0e2d8 (trace_printk_lock){-.-.}-{2:2}, at: bpf_trace_printk+0xcf/0x170 kernel/trace/bpf_trace.c:374
#3: ffffffff8bd87040 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x0/0x340 kernel/trace/./bpf_trace.h:11
stack backtrace:
CPU: 0 PID: 27321 Comm: syz-executor.5 Not tainted 5.19.0-rc4-next-20220628-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/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:885 [inline]
__bpf_prog_run include/linux/filter.h:594 [inline]
bpf_prog_run include/linux/filter.h:601 [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:885 [inline]
__bpf_prog_run include/linux/filter.h:594 [inline]
bpf_prog_run include/linux/filter.h:601 [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
v4l2_open+0x20/0x3f0 drivers/media/v4l2-core/v4l2-dev.c:415
chrdev_open+0x266/0x770 fs/char_dev.c:414
do_dentry_open+0x4a1/0x11f0 fs/open.c:878
do_open fs/namei.c:3520 [inline]
path_openat+0x1c71/0x2930 fs/namei.c:3653
do_filp_open+0x1aa/0x400 fs/namei.c:3680
do_sys_openat2+0x16d/0x4c0 fs/open.c:1308
do_sys_open fs/open.c:1324 [inline]
__do_sys_openat fs/open.c:1340 [inline]
__se_sys_openat fs/open.c:1335 [inline]
__x64_sys_openat+0x13f/0x1f0 fs/open.c:1335
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+0x46/0xb0
RIP: 0033:0x7f630043c124
Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44
RSP: 002b:00007f63015b6ca0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 6666666666666667 RCX: 00007f630043c124
RDX: 0000000000000002 RSI: 00007f63015b6d40 RDI: 00000000ffffff9c
RBP: 00007f63015b6d40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002
R13: 00007ffc5d3be1ff R14: 00007f63015b7300 R15: 0000000000022000
------------[ cut here ]------------
WARNING: CPU: 0 PID: 27321 at kernel/bpf/helpers.c:791 try_get_fmt_tmp_buf kernel/bpf/helpers.c:791 [inline]
WARNING: CPU: 0 PID: 27321 at kernel/bpf/helpers.c:791 bpf_bprintf_prepare+0xf31/0x11a0 kernel/bpf/helpers.c:839
Modules linked in:
CPU: 0 PID: 27321 Comm: syz-executor.5 Not tainted 5.19.0-rc4-next-20220628-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/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 43 d7 ea ff 48 83 7c 24 08 00 41 bd 04 00 00 00 0f 85 8a fa ff ff e8 2c d7 ea ff 8d 6b 03 e9 f7 f6 ff ff e8 1f d7 ea ff <0f> 0b 65 ff 0d 4e 61 73 7e bf 01 00 00 00 41 bc f0 ff ff ff e8 f6
RSP: 0018:ffffc9000d1c68e0 EFLAGS: 00010046
RAX: 0000000000040000 RBX: 0000000000000002 RCX: ffffc90014c8f000
RDX: 0000000000040000 RSI: ffffffff818fdff1 RDI: 0000000000000005
RBP: ffffc9000d1c6a10 R08: 0000000000000005 R09: 0000000000000003
R10: 0000000000000004 R11: 3e4b5341542f3c20 R12: 0000000000000003
R13: 0000000000000004 R14: ffffc9000d1c6ac8 R15: 0000000000000003
FS: 00007f63015b7700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f63015b6d38 CR3: 000000007aea2000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
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:885 [inline]
__bpf_prog_run include/linux/filter.h:594 [inline]
bpf_prog_run include/linux/filter.h:601 [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:885 [inline]
__bpf_prog_run include/linux/filter.h:594 [inline]
bpf_prog_run include/linux/filter.h:601 [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:885 [inline]
__bpf_prog_run include/linux/filter.h:594 [inline]
bpf_prog_run include/linux/filter.h:601 [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:885 [inline]
__bpf_prog_run include/linux/filter.h:594 [inline]
bpf_prog_run include/linux/filter.h:601 [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
v4l2_open+0x20/0x3f0 drivers/media/v4l2-core/v4l2-dev.c:415
chrdev_open+0x266/0x770 fs/char_dev.c:414
do_dentry_open+0x4a1/0x11f0 fs/open.c:878
do_open fs/namei.c:3520 [inline]
path_openat+0x1c71/0x2930 fs/namei.c:3653
do_filp_open+0x1aa/0x400 fs/namei.c:3680
do_sys_openat2+0x16d/0x4c0 fs/open.c:1308
do_sys_open fs/open.c:1324 [inline]
__do_sys_openat fs/open.c:1340 [inline]
__se_sys_openat fs/open.c:1335 [inline]
__x64_sys_openat+0x13f/0x1f0 fs/open.c:1335
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+0x46/0xb0
RIP: 0033:0x7f630043c124
Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44
RSP: 002b:00007f63015b6ca0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 6666666666666667 RCX: 00007f630043c124
RDX: 0000000000000002 RSI: 00007f63015b6d40 RDI: 00000000ffffff9c
RBP: 00007f63015b6d40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002
R13: 00007ffc5d3be1ff R14: 00007f63015b7300 R15: 0000000000022000