============================================ WARNING: possible recursive locking detected 6.1.0-rc8-next-20221207-syzkaller #0 Not tainted -------------------------------------------- syz-executor.0/32658 is trying to acquire lock: ffffffff8c819d98 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline] ffffffff8c819d98 (trace_printk_lock){-.-.}-{2:2}, at: bpf_trace_printk+0xd3/0x170 kernel/trace/bpf_trace.c:377 but task is already holding lock: ffffffff8c819d98 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline] ffffffff8c819d98 (trace_printk_lock){-.-.}-{2:2}, at: bpf_trace_printk+0xd3/0x170 kernel/trace/bpf_trace.c:377 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 6 locks held by syz-executor.0/32658: #0: ffff88814b320460 (sb_writers#4){.+.+}-{0:0}, at: open_last_lookups fs/namei.c:3470 [inline] #0: ffff88814b320460 (sb_writers#4){.+.+}-{0:0}, at: path_openat+0x2a25/0x2a50 fs/namei.c:3711 #1: ffff88801bcc2c20 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff88801bcc2c20 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: open_last_lookups fs/namei.c:3478 [inline] #1: ffff88801bcc2c20 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: path_openat+0x90f/0x2a50 fs/namei.c:3711 #2: ffffffff8cfb3528 (tomoyo_ss){....}-{0:0}, at: tomoyo_path_number_perm+0x1c1/0x570 security/tomoyo/file.c:742 #3: ffffffff8c791900 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2258 [inline] #3: ffffffff8c791900 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xbd/0x3d0 kernel/trace/bpf_trace.c:2302 #4: ffffffff8c819d98 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline] #4: ffffffff8c819d98 (trace_printk_lock){-.-.}-{2:2}, at: bpf_trace_printk+0xd3/0x170 kernel/trace/bpf_trace.c:377 #5: ffffffff8c791900 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2258 [inline] #5: ffffffff8c791900 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xbd/0x3d0 kernel/trace/bpf_trace.c:2302 stack backtrace: CPU: 0 PID: 32658 Comm: syz-executor.0 Not tainted 6.1.0-rc8-next-20221207-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2990 [inline] check_deadlock kernel/locking/lockdep.c:3033 [inline] validate_chain kernel/locking/lockdep.c:3818 [inline] __lock_acquire.cold+0x116/0x3a7 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162 ____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline] bpf_trace_printk+0xd3/0x170 kernel/trace/bpf_trace.c:377 bpf_prog_0605f9f479290f07+0x37/0x3b bpf_dispatcher_nop_func include/linux/bpf.h:1082 [inline] __bpf_prog_run include/linux/filter.h:600 [inline] bpf_prog_run include/linux/filter.h:607 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2263 [inline] bpf_trace_run2+0x151/0x3d0 kernel/trace/bpf_trace.c:2302 __bpf_trace_contention_end+0xb9/0xf0 include/trace/events/lock.h:122 trace_contention_end.constprop.0+0x140/0x230 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x25c/0xb50 kernel/locking/qspinlock.c:560 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+0x204/0x2b0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x45/0x60 kernel/locking/spinlock.c:162 ____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline] bpf_trace_printk+0xd3/0x170 kernel/trace/bpf_trace.c:377 bpf_prog_0605f9f479290f07+0x37/0x3b bpf_dispatcher_nop_func include/linux/bpf.h:1082 [inline] __bpf_prog_run include/linux/filter.h:600 [inline] bpf_prog_run include/linux/filter.h:607 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2263 [inline] bpf_trace_run2+0x151/0x3d0 kernel/trace/bpf_trace.c:2302 __traceiter_kfree+0x2d/0x40 include/trace/events/kmem.h:94 trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0xfc/0x1a0 mm/slab_common.c:1007 tomoyo_realpath_from_path+0xb6/0x600 security/tomoyo/realpath.c:250 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x217/0x570 security/tomoyo/file.c:723 tomoyo_path_mknod+0x111/0x190 security/tomoyo/tomoyo.c:251 security_path_mknod+0xfd/0x180 security/security.c:1180 may_o_create fs/namei.c:3235 [inline] lookup_open.isra.0+0x481/0x1270 fs/namei.c:3376 open_last_lookups fs/namei.c:3481 [inline] path_openat+0x975/0x2a50 fs/namei.c:3711 do_filp_open+0x1ba/0x410 fs/namei.c:3741 do_sys_openat2+0x16d/0x4c0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_creat fs/open.c:1402 [inline] __se_sys_creat fs/open.c:1396 [inline] __x64_sys_creat+0xcd/0x120 fs/open.c:1396 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f3fd368c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3fd43ad168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f3fd37abf80 RCX: 00007f3fd368c0d9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000240 RBP: 00007f3fd36e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc5c2282ef R14: 00007f3fd43ad300 R15: 0000000000022000