syzbot


possible deadlock in unix_del_edges

Status: fixed on 2024/05/22 23:16
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+7f7f201cc2668a8fd169@syzkaller.appspotmail.com
Fix commit: b46f4eaa4f0e af_unix: Clear stale u->oob_skb.
First crash: 48d, last: 44d
Discussions (4)
Title Replies (including bot) Last reply
[PATCH v2 net] af_unix: Clear stale u->oob_skb. 3 (3) 2024/04/09 03:30
[syzbot] [net?] possible deadlock in unix_del_edges 4 (9) 2024/04/06 15:15
Re: [PATCH v2 net] af_unix: Clear stale u->oob_skb. 2 (2) 2024/04/05 23:28
[PATCH v1 net] af_unix: Clear stale u->oob_skb. 3 (3) 2024/04/05 21:54
Last patch testing requests (3)
Created Duration User Patch Repo Result
2024/04/05 05:28 21m (2) kuniyu@amazon.com patch git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git 4090fa373f0e763c43610853d2774b5979915959 error OK
2024/04/04 23:56 7h54m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2b3d5988ae2c OK log
2024/04/04 21:13 6h43m kuniyu@amazon.com patch git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main error OK

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.9.0-rc2-next-20240404-syzkaller #0 Not tainted
--------------------------------------------
kworker/u8:3/51 is trying to acquire lock:
ffffffff8f6dc178 (unix_gc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffffffff8f6dc178 (unix_gc_lock){+.+.}-{2:2}, at: unix_del_edges+0x30/0x590 net/unix/garbage.c:227

but task is already holding lock:
ffffffff8f6dc178 (unix_gc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffffffff8f6dc178 (unix_gc_lock){+.+.}-{2:2}, at: __unix_gc+0xc5/0x1830 net/unix/garbage.c:547

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

       CPU0
       ----
  lock(unix_gc_lock);
  lock(unix_gc_lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by kworker/u8:3/51:
 #0: ffff888015089148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3193 [inline]
 #0: ffff888015089148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3299
 #1: ffffc90000bb7d00 (unix_gc_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3194 [inline]
 #1: ffffc90000bb7d00 (unix_gc_work){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3299
 #2: ffffffff8f6dc178 (unix_gc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #2: ffffffff8f6dc178 (unix_gc_lock){+.+.}-{2:2}, at: __unix_gc+0xc5/0x1830 net/unix/garbage.c:547
 #3: ffff88802bd76118 (rlock-AF_UNIX){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #3: ffff88802bd76118 (rlock-AF_UNIX){+.+.}-{2:2}, at: unix_collect_skb+0xb8/0x700 net/unix/garbage.c:343

stack backtrace:
CPU: 0 PID: 51 Comm: kworker/u8:3 Not tainted 6.9.0-rc2-next-20240404-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: events_unbound __unix_gc
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_deadlock kernel/locking/lockdep.c:3062 [inline]
 validate_chain+0x15c1/0x58e0 kernel/locking/lockdep.c:3856
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
 spin_lock include/linux/spinlock.h:351 [inline]
 unix_del_edges+0x30/0x590 net/unix/garbage.c:227
 unix_destroy_fpl+0x59/0x210 net/unix/garbage.c:286
 unix_detach_fds net/unix/af_unix.c:1816 [inline]
 unix_destruct_scm+0x13e/0x210 net/unix/af_unix.c:1873
 skb_release_head_state+0x100/0x250 net/core/skbuff.c:1162
 skb_release_all net/core/skbuff.c:1173 [inline]
 __kfree_skb net/core/skbuff.c:1189 [inline]
 kfree_skb_reason+0x16d/0x3b0 net/core/skbuff.c:1225
 kfree_skb include/linux/skbuff.h:1262 [inline]
 unix_collect_skb+0x5e4/0x700 net/unix/garbage.c:361
 __unix_walk_scc net/unix/garbage.c:481 [inline]
 unix_walk_scc net/unix/garbage.c:506 [inline]
 __unix_gc+0x108c/0x1830 net/unix/garbage.c:559
 process_one_work kernel/workqueue.c:3218 [inline]
 process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380
 kthread+0x2f0/0x390 kernel/kthread.c:388
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
 </TASK>

Crashes (49):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/04 16:12 linux-next 2b3d5988ae2c 0ee3535e .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/09 07:23 linux-next a053fd3ca5d1 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/09 04:29 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/09 01:16 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/09 00:31 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 23:26 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 21:36 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 18:57 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 17:16 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 17:16 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 17:16 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:50 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:42 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:42 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:41 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:41 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:41 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:41 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 15:41 linux-next 11cb68ad52ac 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 14:35 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 14:35 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 12:48 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 10:58 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 10:37 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 09:48 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 09:47 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 09:29 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 07:56 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 07:30 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 07:30 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 07:25 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 07:25 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 07:25 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 07:25 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 06:55 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 06:33 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 06:33 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 06:33 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/08 06:33 linux-next 11cb68ad52ac ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/07 01:16 linux-next 8568bb2ccc27 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/07 01:14 linux-next 8568bb2ccc27 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/06 20:59 linux-next 8568bb2ccc27 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
2024/04/04 15:26 linux-next 2b3d5988ae2c 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in unix_del_edges
* Struck through repros no longer work on HEAD.