syzbot


possible deadlock in inet_csk_accept

Status: fixed on 2020/04/15 17:19
Subsystems: net
[Documentation on labels]
Fix commit: 06669ea346e4 net: memcg: fix lockdep splat in inet_csk_accept()
First crash: 1555d, last: 1554d
Cause bisection: introduced by (bisect log) :
commit d752a4986532cb6305dfd5290a614cde8072769d
Author: Shakeel Butt <shakeelb@google.com>
Date: Tue Mar 10 05:16:06 2020 +0000

  net: memcg: late association of sock to memcg

Crash: possible deadlock in inet_csk_accept (log)
Repro: C syz .config
  

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.6.0-rc3-syzkaller #0 Not tainted
--------------------------------------------
syz-executor598/9524 is trying to acquire lock:
ffff88808b5b8b90 (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1541 [inline]
ffff88808b5b8b90 (sk_lock-AF_INET6){+.+.}, at: inet_csk_accept+0x69f/0xd30 net/ipv4/inet_connection_sock.c:492

but task is already holding lock:
ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1541 [inline]
ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: inet_csk_accept+0x8d/0xd30 net/ipv4/inet_connection_sock.c:445

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

       CPU0
       ----
  lock(sk_lock-AF_INET6);
  lock(sk_lock-AF_INET6);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

1 lock held by syz-executor598/9524:
 #0: ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1541 [inline]
 #0: ffff88808b5b9590 (sk_lock-AF_INET6){+.+.}, at: inet_csk_accept+0x8d/0xd30 net/ipv4/inet_connection_sock.c:445

stack backtrace:
CPU: 0 PID: 9524 Comm: syz-executor598 Not tainted 5.6.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 print_deadlock_bug kernel/locking/lockdep.c:2370 [inline]
 check_deadlock kernel/locking/lockdep.c:2411 [inline]
 validate_chain kernel/locking/lockdep.c:2954 [inline]
 __lock_acquire.cold+0x114/0x288 kernel/locking/lockdep.c:3954
 lock_acquire+0x197/0x420 kernel/locking/lockdep.c:4484
 lock_sock_nested+0xc5/0x110 net/core/sock.c:2947
 lock_sock include/net/sock.h:1541 [inline]
 inet_csk_accept+0x69f/0xd30 net/ipv4/inet_connection_sock.c:492
 inet_accept+0xe9/0x7c0 net/ipv4/af_inet.c:734
 __sys_accept4_file+0x3ac/0x5b0 net/socket.c:1758
 __sys_accept4+0x53/0x90 net/socket.c:1809
 __do_sys_accept4 net/socket.c:1821 [inline]
 __se_sys_accept4 net/socket.c:1818 [inline]
 __x64_sys_accept4+0x93/0xf0 net/socket.c:1818
 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4445c9
Code: e8 0c 0d 03 00 48 83 c4 18 c3 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 0f 83 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffc35b37608 EFLAGS: 00000246 ORIG_RAX: 0000000000000120
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004445c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000306777 R09: 0000000000306777
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00000000004053d0 R14: 0000000000000000 R15: 0000000000000000

Crashes (992):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/11 04:59 net-old ece0d7bd7461 35f53e45 .config console log report syz C ci-upstream-net-this-kasan-gce
2020/03/12 06:37 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 05:52 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 05:41 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 04:40 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 04:00 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 03:09 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 02:18 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 01:29 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 00:29 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 23:45 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 23:07 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 23:00 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 21:57 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 20:57 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 20:56 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 19:54 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 18:58 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 18:11 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 17:47 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 17:30 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 17:14 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 16:54 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 16:35 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 16:17 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 15:58 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 15:38 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 15:20 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 14:56 net-old 2165fdf4bc2d e7caca8e .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 14:09 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 13:57 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 12:55 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 11:57 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 11:06 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 10:54 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 09:29 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 09:01 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 08:19 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 08:07 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 07:02 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 07:01 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 05:56 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/11 00:10 net-old ece0d7bd7461 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
* Struck through repros no longer work on HEAD.