============================================
WARNING: possible recursive locking detected
6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7 #0 Not tainted
--------------------------------------------
syz.1.998/9510 is trying to acquire lock:
ffffc900044dd0d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
but task is already holding lock:
ffffc90003a590d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&rb->spinlock);
lock(&rb->spinlock);
*** DEADLOCK ***
May be due to missing lock nesting notation
7 locks held by syz.1.998/9510:
#0: ffff88801230cd98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline]
#0: ffff88801230cd98 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:6099 [inline]
#0: ffff88801230cd98 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x35/0x6a0 mm/memory.c:6159
#1: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#1: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#1: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: count_memcg_events_mm.constprop.0+0x3a/0x340 include/linux/memcontrol.h:1042
#2: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#2: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#2: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: ieee80211_rx_napi+0xa6/0x400 net/mac80211/rx.c:5484
#3: ffff888046a60168 (&rdev->bss_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
#3: ffff888046a60168 (&rdev->bss_lock){+.-.}-{2:2}, at: cfg80211_inform_single_bss_data+0x791/0x1de0 net/wireless/scan.c:2328
#4: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#4: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#4: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline]
#4: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2359
#5: ffffc90003a590d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
#6: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#6: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#6: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline]
#6: ffffffff8e1b8340 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2359
stack backtrace:
CPU: 2 UID: 0 PID: 9510 Comm: syz.1.998 Not tainted 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_deadlock_bug+0x2e3/0x410 kernel/locking/lockdep.c:3037
check_deadlock kernel/locking/lockdep.c:3089 [inline]
validate_chain kernel/locking/lockdep.c:3891 [inline]
__lock_acquire+0x2185/0x3ce0 kernel/locking/lockdep.c:5202
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
____bpf_ringbuf_output kernel/bpf/ringbuf.c:553 [inline]
bpf_ringbuf_output+0x60/0xd0 kernel/bpf/ringbuf.c:543
bpf_prog_a3e2825f60354855+0x46/0x4a
bpf_dispatcher_nop_func include/linux/bpf.h:1257 [inline]
__bpf_prog_run include/linux/filter.h:701 [inline]
bpf_prog_run include/linux/filter.h:708 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2318 [inline]
bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2359
__bpf_trace_contention_end+0xca/0x110 include/trace/events/lock.h:122
trace_contention_end.constprop.0+0xea/0x170 include/trace/events/lock.h:122
__pv_queued_spin_lock_slowpath+0x27e/0xc90 kernel/locking/qspinlock.c:557
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
__bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
____bpf_ringbuf_output kernel/bpf/ringbuf.c:553 [inline]
bpf_ringbuf_output+0x60/0xd0 kernel/bpf/ringbuf.c:543
bpf_prog_a3e2825f60354855+0x46/0x4a
bpf_dispatcher_nop_func include/linux/bpf.h:1257 [inline]
__bpf_prog_run include/linux/filter.h:701 [inline]
bpf_prog_run include/linux/filter.h:708 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2318 [inline]
bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2359
trace_kfree include/trace/events/kmem.h:94 [inline]
kfree+0x258/0x4b0 mm/slub.c:4715
ieee80211_inform_bss+0x76e/0x1100 net/mac80211/scan.c:160
rdev_inform_bss net/wireless/rdev-ops.h:418 [inline]
cfg80211_inform_single_bss_data+0x8f6/0x1de0 net/wireless/scan.c:2333
cfg80211_inform_bss_data+0x205/0x3ba0 net/wireless/scan.c:3184
cfg80211_inform_bss_frame_data+0x271/0x7a0 net/wireless/scan.c:3279
ieee80211_bss_info_update+0x311/0xab0 net/mac80211/scan.c:226
ieee80211_scan_rx+0x474/0xac0 net/mac80211/scan.c:340
__ieee80211_rx_handle_packet net/mac80211/rx.c:5225 [inline]
ieee80211_rx_list+0x1be3/0x2e90 net/mac80211/rx.c:5462
ieee80211_rx_napi+0xdd/0x400 net/mac80211/rx.c:5485
ieee80211_rx include/net/mac80211.h:5138 [inline]
ieee80211_handle_queued_frames+0xd5/0x130 net/mac80211/main.c:439
tasklet_action_common+0x24c/0x3e0 kernel/softirq.c:784
handle_softirqs+0x213/0x8f0 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu kernel/softirq.c:637 [inline]
irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1037
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:rcu_read_unlock include/linux/rcupdate.h:878 [inline]
RIP: 0010:count_memcg_events_mm.constprop.0+0x108/0x340 include/linux/memcontrol.h:1046
Code: ba 01 00 00 00 89 de 48 89 ef e8 c3 33 22 00 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 81 58 b8 ff 48 85 db 0f 85 06 02 00 00 03 56 b8 ff e8 7e 8d 4c 09 31 ff 89 c3 89 c6 e8 33 58 b8 ff 85
RSP: 0018:ffffc900016af9a8 EFLAGS: 00000246
RAX: 0000000000040000 RBX: 0000000000000000 RCX: ffffc9002b915000
RDX: 0000000000040000 RSI: ffffffff81d534e8 RDI: 0000000000000007
RBP: ffff888048e5a000 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000200
R13: ffff888048ec3bc0 R14: 0000000000000000 R15: ffff888054bdc880
count_memcg_event_mm include/linux/memcontrol.h:1052 [inline]
mm_account_fault mm/memory.c:5928 [inline]
handle_mm_fault+0x5cc/0xaa0 mm/memory.c:6088
do_user_addr_fault+0x7a3/0x13f0 arch/x86/mm/fault.c:1389
handle_page_fault arch/x86/mm/fault.c:1481 [inline]
exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1539
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:copy_user_generic arch/x86/include/asm/uaccess_64.h:121 [inline]
RIP: 0010:raw_copy_from_user arch/x86/include/asm/uaccess_64.h:136 [inline]
RIP: 0010:_inline_copy_from_user include/linux/uaccess.h:170 [inline]
RIP: 0010:_copy_from_user+0xc1/0xf0 lib/usercopy.c:18
Code: 89 df e8 a2 12 fe fc 4d 85 f6 75 9e e8 e8 10 fe fc 0f ae e8 89 ee 4c 89 ef e8 6b 8d 5f fd 0f 01 cb 48 89 e9 4c 89 ef 48 89 de a4 0f 1f 00 48 89 cb 0f 01 ca e9 73 ff ff ff e8 ba 10 fe fc 48
RSP: 0018:ffffc900016afb60 EFLAGS: 00050297
RAX: 0000000000000001 RBX: 000000002048bc3a RCX: 00000000000001a7
RDX: ffffed100afc70ad RSI: 000000002048c000 RDI: ffff888057e383c6
RBP: 000000000000056d R08: 0000000000000001 R09: ffffed100afc70ad
R10: 0000000000000004 R11: 0000000000000000 R12: 000000002048c1a7
R13: ffff888057e38000 R14: 0000000000000000 R15: ffff88802e407560
copy_from_user include/linux/uaccess.h:203 [inline]
generic_map_update_batch+0x3ff/0x5f0 kernel/bpf/syscall.c:1846
bpf_map_do_batch+0x5a8/0x670 kernel/bpf/syscall.c:5143
__sys_bpf+0x1ce4/0x49a0 kernel/bpf/syscall.c:5698
__do_sys_bpf kernel/bpf/syscall.c:5741 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5739 [inline]
__x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5739
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff2d517dff9
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:00007ff2d603f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007ff2d5335f80 RCX: 00007ff2d517dff9
RDX: 0000000000000038 RSI: 00000000200006c0 RDI: 000000000000001a
RBP: 00007ff2d51f0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff2d5335f80 R15: 00007fff0b5009e8
----------------
Code disassembly (best guess):
0: ba 01 00 00 00 mov $0x1,%edx
5: 89 de mov %ebx,%esi
7: 48 89 ef mov %rbp,%rdi
a: e8 c3 33 22 00 call 0x2233d2
f: 9c pushf
10: 5b pop %rbx
11: 81 e3 00 02 00 00 and $0x200,%ebx
17: 31 ff xor %edi,%edi
19: 48 89 de mov %rbx,%rsi
1c: e8 81 58 b8 ff call 0xffb858a2
21: 48 85 db test %rbx,%rbx
24: 0f 85 06 02 00 00 jne 0x230
* 2a: e8 03 56 b8 ff call 0xffb85632 <-- trapping instruction
2f: e8 7e 8d 4c 09 call 0x94c8db2
34: 31 ff xor %edi,%edi
36: 89 c3 mov %eax,%ebx
38: 89 c6 mov %eax,%esi
3a: e8 33 58 b8 ff call 0xffb85872
3f: 85 .byte 0x85