syzbot


possible deadlock in trie_delete_elem

Status: upstream: reported C repro on 2024/03/19 12:09
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+c361763297bd80b2cc11@syzkaller.appspotmail.com
First crash: 247d, last: 1h56m
Bug presence (1)
Date Name Commit Repro Result
2024/05/03 upstream (ToT) 3d25a941ea50 C [report] possible deadlock in trie_delete_elem
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in trie_delete_elem bpf C done 21065 1h19m 246d 0/28 upstream: reported C repro on 2024/03/20 08:42
linux-6.1 possible deadlock in trie_delete_elem origin:upstream C 3086 1h22m 246d 0/3 upstream: reported C repro on 2024/03/20 00:33

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.15.167-syzkaller #0 Not tainted
--------------------------------------------
syz-executor585/3604 is trying to acquire lock:
ffff88807debe9b8 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450

but task is already holding lock:
ffff88807debe9b8 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&trie->lock);
  lock(&trie->lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by syz-executor585/3604:
 #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline]
 #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501
 #1: ffffffff8c91fc60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
 #2: ffff88807debe9b8 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450
 #3: ffffffff8c91fc60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311

stack backtrace:
CPU: 1 PID: 3604 Comm: syz-executor585 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline]
 check_deadlock kernel/locking/lockdep.c:2989 [inline]
 validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450
 bpf_prog_8c8ab8634bca3061+0x3a/0x4b0
 bpf_dispatcher_nop_func include/linux/bpf.h:790 [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:1880 [inline]
 bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
 __bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201
 trace_mm_page_alloc include/trace/events/kmem.h:201 [inline]
 __alloc_pages+0x6e0/0x700 mm/page_alloc.c:5445
 stack_depot_save+0x319/0x440 lib/stackdepot.c:302
 save_stack+0x104/0x1e0 mm/page_owner.c:120
 __set_page_owner+0x37/0x300 mm/page_owner.c:181
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423
 stack_depot_save+0x319/0x440 lib/stackdepot.c:302
 kasan_save_stack+0x4d/0x60 mm/kasan/common.c:40
 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596
 trie_delete_elem+0x520/0x690
 bpf_prog_8c8ab8634bca3061+0x3a/0x4b0
 bpf_dispatcher_nop_func include/linux/bpf.h:790 [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:1880 [inline]
 bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
 __bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201
 trace_mm_page_alloc include/trace/events/kmem.h:201 [inline]
 __alloc_pages+0x6e0/0x700 mm/page_alloc.c:5445
 alloc_pages_vma+0x39a/0x800 mm/mempolicy.c:2146
 wp_page_copy+0x24e/0x2070 mm/memory.c:3026
 handle_pte_fault mm/memory.c:4638 [inline]
 __handle_mm_fault mm/memory.c:4755 [inline]
 handle_mm_fault+0x2a3d/0x5960 mm/memory.c:4853
 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline]
 handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0033:0x7fdb7c21d060
Code: 41 54 55 48 89 f5 53 89 fb 48 83 ec 18 48 83 3d 8d 0f 0a 00 00 89 54 24 0c 74 08 84 c9 0f 85 09 02 00 00 31 c0 ba 01 00 00 00 <f0> 0f b1 15 80 3c 0a 00 0f 85 0f 02 00 00 4c 8d 25 73 3c 0a 00 4c
RSP: 002b:00007fff44de24a0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 00007fdb7c2be120 RDI: 0000000000000000
RBP: 00007fdb7c2be120 R08: 0000000000000006 R09: 0000000000000006
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (3125):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/12 22:31 linux-5.15.y 3a5928702e71 084d8178 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/09/22 17:34 linux-5.15.y 3a5928702e71 6f888b75 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/09/21 12:55 linux-5.15.y 3a5928702e71 6f888b75 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/09/16 12:18 linux-5.15.y 3a5928702e71 08d8a733 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/09/01 02:11 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/06/08 15:42 linux-5.15.y c61bd26ae81a 82c05ab8 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/05/14 21:09 linux-5.15.y 284087d4f7d5 fdb4c10c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/26 08:21 linux-5.15.y c52b9710c83d 8bdc0f22 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/26 04:09 linux-5.15.y c52b9710c83d 8bdc0f22 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/24 10:55 linux-5.15.y c52b9710c83d 21339d7b .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/18 16:16 linux-5.15.y c52b9710c83d af24b050 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/06 06:50 linux-5.15.y 9465fef4ae35 ca620dd8 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/05 16:14 linux-5.15.y 9465fef4ae35 77230c29 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/05 11:36 linux-5.15.y 9465fef4ae35 0ee3535e .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/01 16:34 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/04/01 14:38 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/30 04:20 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/28 20:14 linux-5.15.y 9465fef4ae35 e91187ee .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/25 22:24 linux-5.15.y b95c01af2113 0ea90952 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/23 23:24 linux-5.15.y b95c01af2113 0ea90952 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/20 04:58 linux-5.15.y b95c01af2113 a485f239 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/20 04:22 linux-5.15.y b95c01af2113 a485f239 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/20 03:52 linux-5.15.y b95c01af2113 a485f239 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/20 02:06 linux-5.15.y b95c01af2113 e104824c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/20 01:35 linux-5.15.y b95c01af2113 e104824c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/20 01:06 linux-5.15.y b95c01af2113 e104824c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/21 11:57 linux-5.15.y 0a51d2d4527b 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/21 10:28 linux-5.15.y 0a51d2d4527b 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/21 08:07 linux-5.15.y 0a51d2d4527b 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/21 04:14 linux-5.15.y 0a51d2d4527b 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/20 21:48 linux-5.15.y 0a51d2d4527b 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/20 16:38 linux-5.15.y 0a51d2d4527b 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/20 15:32 linux-5.15.y 0a51d2d4527b 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/20 09:31 linux-5.15.y 0a51d2d4527b 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/20 04:32 linux-5.15.y 0a51d2d4527b 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/20 03:17 linux-5.15.y 0a51d2d4527b 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/20 01:26 linux-5.15.y 0a51d2d4527b 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/19 20:54 linux-5.15.y 0a51d2d4527b 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/19 19:45 linux-5.15.y 0a51d2d4527b 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/19 15:03 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/19 12:08 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/19 09:59 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/19 07:23 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/19 06:19 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/19 06:19 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/19 04:40 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/19 02:40 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/18 22:41 linux-5.15.y 0a51d2d4527b e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/18 09:43 linux-5.15.y 0a51d2d4527b cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/17 08:57 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/16 15:48 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/16 05:40 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/15 01:40 linux-5.15.y d98fd109f827 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/13 21:59 linux-5.15.y 3c17fc483905 bb3f8425 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/13 07:17 linux-5.15.y 3c17fc483905 62026c85 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/11 07:34 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/10 16:13 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/10 16:13 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/10 01:21 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/08 11:53 linux-5.15.y 72244eab0dad 179b040e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/06 23:53 linux-5.15.y 72244eab0dad df3dc63b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/06 13:07 linux-5.15.y 72244eab0dad 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/06 11:37 linux-5.15.y 72244eab0dad 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/05 22:44 linux-5.15.y 72244eab0dad da38b4c9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in trie_delete_elem
2024/11/04 20:31 linux-5.15.y 72244eab0dad 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/04 15:20 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/04 15:18 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/04 13:59 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/04 12:31 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/11/04 10:57 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
2024/03/19 12:09 linux-5.15.y b95c01af2113 e104824c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in trie_delete_elem
* Struck through repros no longer work on HEAD.