syzbot


possible deadlock in sock_map_delete_elem

Status: upstream: reported C repro on 2024/04/06 16:22
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+3a838a382d1ea3f3a4d7@syzkaller.appspotmail.com
First crash: 184d, last: 117d
Fix commit to backport (bisect log) :
tree: upstream
commit 56a5cf538c3f2d935b0d81040a8303b6e7fc5fd8
Author: MD Danish Anwar <danishanwar@ti.com>
Date: Mon May 27 06:30:15 2024 +0000

  net: ti: icssg-prueth: Fix start counter for ft1 filter

  
Bug presence (3)
Date Name Commit Repro Result
2024/06/12 linux-6.1.y (ToT) ae9f2a70d69e C [report] INFO: rcu detected stall in corrupted
2024/04/28 upstream (ToT) 2c8159388952 C [report] possible deadlock in sock_map_delete_elem
2024/06/12 upstream (ToT) 2ef5971ff345 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in sock_map_delete_elem net bpf C error done 869 118d 203d 0/28 upstream: reported C repro on 2024/03/18 16:03
linux-5.15 possible deadlock in sock_map_delete_elem origin:lts-only C error 99 113d 200d 0/3 upstream: reported C repro on 2024/03/21 17:46
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/06/14 10:38 8h48m (3) fix candidate upstream OK (1) job log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.1.90-syzkaller #0 Not tainted
--------------------------------------------
syz-executor177/3546 is trying to acquire lock:
ffff888076498a40 (&stab->lock){+...}-{2:2}, at: __sock_map_delete net/core/sock_map.c:419 [inline]
ffff888076498a40 (&stab->lock){+...}-{2:2}, at: sock_map_delete_elem+0x161/0x230 net/core/sock_map.c:451

but task is already holding lock:
ffff88807649fa40 (&stab->lock){+...}-{2:2}, at: sock_map_update_common+0x1b6/0x5b0 net/core/sock_map.c:495

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

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

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz-executor177/3546:
 #0: ffff88807eb4b130 (sk_lock-AF_UNIX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1748 [inline]
 #0: ffff88807eb4b130 (sk_lock-AF_UNIX){+.+.}-{0:0}, at: sock_map_sk_acquire net/core/sock_map.c:119 [inline]
 #0: ffff88807eb4b130 (sk_lock-AF_UNIX){+.+.}-{0:0}, at: sock_map_update_elem_sys+0x1c8/0x910 net/core/sock_map.c:580
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: sock_map_sk_acquire net/core/sock_map.c:120 [inline]
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: sock_map_update_elem_sys+0x1d4/0x910 net/core/sock_map.c:580
 #2: ffff88807649fa40 (&stab->lock){+...}-{2:2}, at: sock_map_update_common+0x1b6/0x5b0 net/core/sock_map.c:495
 #3: ffff8880192f6290 (&psock->link_lock){+...}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
 #3: ffff8880192f6290 (&psock->link_lock){+...}-{2:2}, at: sock_map_del_link net/core/sock_map.c:147 [inline]
 #3: ffff8880192f6290 (&psock->link_lock){+...}-{2:2}, at: sock_map_unref+0xcc/0x5d0 net/core/sock_map.c:182
 #4: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #4: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #4: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
 #4: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312

stack backtrace:
CPU: 0 PID: 3546 Comm: syz-executor177 Not tainted 6.1.90-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2983 [inline]
 check_deadlock kernel/locking/lockdep.c:3026 [inline]
 validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
 _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
 __sock_map_delete net/core/sock_map.c:419 [inline]
 sock_map_delete_elem+0x161/0x230 net/core/sock_map.c:451
 bpf_prog_bd09fd94307bc10c+0x63/0x67
 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
 __bpf_prog_run include/linux/filter.h:603 [inline]
 bpf_prog_run include/linux/filter.h:610 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
 bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:94
 trace_kfree include/trace/events/kmem.h:94 [inline]
 kfree+0xf6/0x190 mm/slab_common.c:994
 sk_psock_free_link include/linux/skmsg.h:416 [inline]
 sock_map_del_link net/core/sock_map.c:160 [inline]
 sock_map_unref+0x3ac/0x5d0 net/core/sock_map.c:182
 sock_map_update_common+0x4ec/0x5b0 net/core/sock_map.c:508
 sock_map_update_elem_sys+0x55b/0x910 net/core/sock_map.c:584
 map_update_elem+0x503/0x680 kernel/bpf/syscall.c:1448
 __sys_bpf+0x337/0x6c0 kernel/bpf/syscall.c:4993
 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5107 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f10605308e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd9a2272c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007ffd9a227498 RCX: 00007f10605308e9
RDX: 0000000000000020 RSI: 0000000020000b40 RDI: 0000000000000002
RBP: 00007f10605a3610 R08: 00007ffd9a227498 R09: 0000

Crashes (79):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/07 17:37 linux-6.1.y 909ba1f1b414 cb2dcc0e .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/30 15:24 linux-6.1.y dcbc050cb0d3 3ce4924c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/24 02:55 linux-6.1.y 6741e066ec76 21339d7b .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/22 18:10 linux-6.1.y 6741e066ec76 36c961ad .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/22 15:41 linux-6.1.y 6741e066ec76 36c961ad .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/22 15:04 linux-6.1.y 6741e066ec76 36c961ad .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/16 07:03 linux-6.1.y cd5d98c0556c 0d592ce4 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/13 09:33 linux-6.1.y bf1e3b1cb1e0 c8349e48 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/13 03:44 linux-6.1.y bf1e3b1cb1e0 c8349e48 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/12 05:00 linux-6.1.y bf1e3b1cb1e0 27de0a5c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/10 22:18 linux-6.1.y bf1e3b1cb1e0 4320ec32 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/06/11 18:12 linux-6.1.y 88690811da69 4d75f4f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/06/10 16:17 linux-6.1.y 88690811da69 048c640a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/06/03 23:28 linux-6.1.y 88690811da69 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/06/03 10:14 linux-6.1.y 88690811da69 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/06/02 23:14 linux-6.1.y 88690811da69 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/06/02 21:38 linux-6.1.y 88690811da69 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/06/02 11:45 linux-6.1.y 88690811da69 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/31 09:43 linux-6.1.y 88690811da69 0c378259 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/28 02:08 linux-6.1.y 88690811da69 f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/27 12:59 linux-6.1.y 88690811da69 761766e6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/27 11:50 linux-6.1.y 88690811da69 761766e6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/25 21:56 linux-6.1.y 88690811da69 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/05/25 21:56 linux-6.1.y 88690811da69 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/05/25 15:29 linux-6.1.y 88690811da69 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/24 17:55 linux-6.1.y 4078fa637fcd a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/21 09:12 linux-6.1.y 4078fa637fcd 4c0d3ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/21 04:07 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/20 09:57 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/19 21:40 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/15 10:31 linux-6.1.y 909ba1f1b414 94b087b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/12 16:39 linux-6.1.y 909ba1f1b414 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/05/10 02:10 linux-6.1.y 909ba1f1b414 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/09 10:37 linux-6.1.y 909ba1f1b414 05079661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/06 15:43 linux-6.1.y 909ba1f1b414 d884b519 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/05/03 21:54 linux-6.1.y 909ba1f1b414 dd26401e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/05/03 13:28 linux-6.1.y 909ba1f1b414 dd26401e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/30 13:04 linux-6.1.y dcbc050cb0d3 3ce4924c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/29 11:45 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/26 20:32 linux-6.1.y 6741e066ec76 059e9963 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/26 02:26 linux-6.1.y 6741e066ec76 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/25 18:28 linux-6.1.y 6741e066ec76 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/25 00:00 linux-6.1.y 6741e066ec76 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/24 17:02 linux-6.1.y 6741e066ec76 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/04/23 10:40 linux-6.1.y 6741e066ec76 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/23 08:45 linux-6.1.y 6741e066ec76 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/23 05:42 linux-6.1.y 6741e066ec76 36c961ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/22 01:13 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/21 19:25 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/21 16:57 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/21 16:49 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/21 16:49 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/21 14:31 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/04/21 12:13 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/04/19 23:52 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/04/18 08:52 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/16 17:03 linux-6.1.y cd5d98c0556c 18f6e127 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/04/16 09:10 linux-6.1.y cd5d98c0556c 0d592ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/16 09:05 linux-6.1.y cd5d98c0556c 0d592ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/15 15:53 linux-6.1.y cd5d98c0556c b9af7e61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in sock_map_delete_elem
2024/04/15 09:51 linux-6.1.y cd5d98c0556c c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/14 17:51 linux-6.1.y cd5d98c0556c c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/14 16:01 linux-6.1.y cd5d98c0556c c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/14 12:04 linux-6.1.y cd5d98c0556c c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/13 10:15 linux-6.1.y bf1e3b1cb1e0 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/09 21:00 linux-6.1.y 347385861c50 171ec371 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
2024/04/06 16:21 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in sock_map_delete_elem
* Struck through repros no longer work on HEAD.