syzbot


possible deadlock in neigh_change_state

Status: auto-obsoleted due to no activity on 2023/04/12 15:45
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+6a3c02010a025ac7b7cf@syzkaller.appspotmail.com
First crash: 1956d, last: 1943d
Cause bisection: introduced by (bisect log) :
commit 58956317c8de52009d1a38a721474c24aef74fe7
Author: David Ahern <dsahern@gmail.com>
Date: Fri Dec 7 20:24:57 2018 +0000

  neighbor: Improve garbage collection

Crash: BUG: corrupted list in neigh_mark_dead (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) [no-op commit]:
commit a1cccdcf330e2a59b72b1588a7ef87cbaaa8a4e9
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date: Thu Sep 20 10:27:04 2018 +0000

  drm/i915: Clean up casts to crtc_state in intel_atomic_commit_tail()

  
Discussions (3)
Title Replies (including bot) Last reply
possible deadlock in neigh_change_state 0 (2) 2019/11/16 21:58
Reminder: 99 open syzbot bugs in net subsystem 14 (14) 2019/07/31 15:13
Reminder: 94 open syzbot bugs in net subsystem 1 (1) 2019/06/25 05:48
Last patch testing requests (9)
Created Duration User Patch Repo Result
2023/04/12 15:07 20m retest repro linux-next OK log
2022/12/10 12:31 5m retest repro linux-next error OK
2022/12/10 09:31 5m retest repro linux-next error OK
2022/12/08 23:31 19m retest repro bpf-next OK log
2022/12/08 23:31 20m retest repro net-next-old OK log
2022/09/01 09:27 5m retest repro linux-next error OK
2022/09/01 05:27 15m retest repro linux-next OK log
2022/08/30 19:27 14m retest repro bpf-next OK log
2022/08/30 19:27 14m retest repro net-next-old OK log

Sample crash report:
IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
8021q: adding VLAN 0 to HW filter on device team0

======================================================
WARNING: possible circular locking dependency detected
4.20.0-rc6+ #174 Not tainted
------------------------------------------------------
syz-executor687/6006 is trying to acquire lock:
000000009a78be90 (&tbl->lock){+.-.}, at: neigh_change_state+0x1dc/0x7a0 net/core/neighbour.c:141

but task is already holding lock:
0000000044286f55 (&n->lock){++--}, at: __neigh_update+0xe6/0x1eb0 net/core/neighbour.c:1203

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&n->lock){++--}:
       __raw_write_lock include/linux/rwlock_api_smp.h:210 [inline]
       _raw_write_lock+0x2d/0x40 kernel/locking/spinlock.c:288
       neigh_flush_dev+0x34f/0x960 net/core/neighbour.c:294
       neigh_changeaddr+0x31/0x40 net/core/neighbour.c:325
       ndisc_netdev_event+0xe6/0x5b0 net/ipv6/ndisc.c:1770
       notifier_call_chain+0x17e/0x380 kernel/notifier.c:93
       __raw_notifier_call_chain kernel/notifier.c:394 [inline]
       raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401
       call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1737
       call_netdevice_notifiers_extack net/core/dev.c:1749 [inline]
       call_netdevice_notifiers net/core/dev.c:1763 [inline]
       dev_set_mac_address+0x293/0x3b0 net/core/dev.c:7780
       do_setlink+0x7c7/0x3f30 net/core/rtnetlink.c:2447
       __rtnl_newlink+0xcde/0x19e0 net/core/rtnetlink.c:3115
       rtnl_newlink+0x6b/0xa0 net/core/rtnetlink.c:3240
       rtnetlink_rcv_msg+0x46a/0xc20 net/core/rtnetlink.c:4969
       netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2477
       rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4987
       netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
       netlink_unicast+0x5a5/0x760 net/netlink/af_netlink.c:1336
       netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1917
       sock_sendmsg_nosec net/socket.c:621 [inline]
       sock_sendmsg+0xd5/0x120 net/socket.c:631
       ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116
       __sys_sendmsg+0x11d/0x280 net/socket.c:2154
       __do_sys_sendmsg net/socket.c:2163 [inline]
       __se_sys_sendmsg net/socket.c:2161 [inline]
       __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161
       do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&tbl->lock){+.-.}:
       lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844
       __raw_write_lock_bh include/linux/rwlock_api_smp.h:203 [inline]
       _raw_write_lock_bh+0x31/0x40 kernel/locking/spinlock.c:312
       neigh_change_state+0x1dc/0x7a0 net/core/neighbour.c:141
       __neigh_update+0x478/0x1eb0 net/core/neighbour.c:1302
       neigh_update+0x37/0x50 net/core/neighbour.c:1372
       arp_req_set+0x54c/0xaa0 net/ipv4/arp.c:1072
       arp_ioctl+0x48b/0xae0 net/ipv4/arp.c:1230
       inet_ioctl+0x237/0x360 net/ipv4/af_inet.c:932
       sock_do_ioctl+0xeb/0x420 net/socket.c:950
       sock_ioctl+0x313/0x690 net/socket.c:1074
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:509 [inline]
       do_vfs_ioctl+0x1de/0x1790 fs/ioctl.c:696
       ksys_ioctl+0xa9/0xd0 fs/ioctl.c:713
       __do_sys_ioctl fs/ioctl.c:720 [inline]
       __se_sys_ioctl fs/ioctl.c:718 [inline]
       __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
       do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&n->lock);
                               lock(&tbl->lock);
                               lock(&n->lock);
  lock(&tbl->lock);

 *** DEADLOCK ***

2 locks held by syz-executor687/6006:
 #0: 00000000f7902c1e (rtnl_mutex){+.+.}, at: rtnl_lock+0x17/0x20 net/core/rtnetlink.c:77
 #1: 0000000044286f55 (&n->lock){++--}, at: __neigh_update+0xe6/0x1eb0 net/core/neighbour.c:1203

stack backtrace:
CPU: 0 PID: 6006 Comm: syz-executor687 Not tainted 4.20.0-rc6+ #174
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+0x244/0x39d lib/dump_stack.c:113
 print_circular_bug.isra.35.cold.54+0x1bd/0x27d kernel/locking/lockdep.c:1221
 check_prev_add kernel/locking/lockdep.c:1863 [inline]
 check_prevs_add kernel/locking/lockdep.c:1976 [inline]
 validate_chain kernel/locking/lockdep.c:2347 [inline]
 __lock_acquire+0x3399/0x4c20 kernel/locking/lockdep.c:3341
 lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844
 __raw_write_lock_bh include/linux/rwlock_api_smp.h:203 [inline]
 _raw_write_lock_bh+0x31/0x40 kernel/locking/spinlock.c:312
 neigh_change_state+0x1dc/0x7a0 net/core/neighbour.c:141
 __neigh_update+0x478/0x1eb0 net/core/neighbour.c:1302
 neigh_update+0x37/0x50 net/core/neighbour.c:1372
 arp_req_set+0x54c/0xaa0 net/ipv4/arp.c:1072
 arp_ioctl+0x48b/0xae0 net/ipv4/arp.c:1230
 inet_ioctl+0x237/0x360 net/ipv4/af_inet.c:932
 sock_do_ioctl+0xeb/0x420 net/socket.c:950
 sock_ioctl+0x313/0x690 net/socket.c:1074
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:509 [inline]
 do_vfs_ioctl+0x1de/0x1790 fs/ioctl.c:696
 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:713
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl fs/ioctl.c:718 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441299
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 db 0a fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd31692a78 EFLAGS: 00000203 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000020000040 RCX: 0000000000441299
RDX: 0000000020000040 RSI: 0000000000008955 RDI: 0000000000000003
RBP: 00000000006cc018 R08: 0000000000000100 R09: 0000000000000100
R10: 0000000000000100 R11: 0000000000000203 R12: 0000000000402200
R13: 0000000000402290 R14: 0000000000000000 R15: 0000000000000000

Crashes (3278):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/11 14:10 bpf-next addb0679839a 7795ae03 .config console log report syz C ci-upstream-bpf-next-kasan-gce
2018/12/11 13:17 net-next-old addb0679839a 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/13 11:46 linux-next ca40dc225d19 f3d9d594 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/13 09:07 linux-next ca40dc225d19 02613a41 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/20 06:24 bpf-next e2ce3674883e 02e69052 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 20:54 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 20:36 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 19:34 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 18:47 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 18:30 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 17:28 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 17:09 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 16:02 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 15:35 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 14:35 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 14:26 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 13:25 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 13:17 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 12:13 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 11:33 bpf-next 76c43ae84e3f fe2dc057 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 10:28 bpf-next 76c43ae84e3f 4edaba93 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/19 09:28 bpf-next 76c43ae84e3f 4edaba93 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/15 06:59 net-next-old 2aa55dccf83d 7624ddd6 .config console log report ci-upstream-net-kasan-gce
2018/12/11 12:55 bpf-next addb0679839a 7795ae03 .config console log report ci-upstream-bpf-next-kasan-gce
2018/12/24 10:25 linux-next 6648e120dd1a be79df56 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/24 06:32 linux-next 6648e120dd1a be79df56 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/23 18:08 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/23 08:26 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/23 01:16 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 23:59 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 21:48 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 20:32 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 19:16 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 13:40 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 12:49 linux-next 6648e120dd1a e3bd7ab8 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 10:48 linux-next 6648e120dd1a 603b5124 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 07:12 linux-next 6648e120dd1a 603b5124 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 04:25 linux-next 6648e120dd1a 603b5124 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 01:51 linux-next 6648e120dd1a 603b5124 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/22 00:48 linux-next 6648e120dd1a 603b5124 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/21 23:33 linux-next 6648e120dd1a 588075e6 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/21 13:45 linux-next 6648e120dd1a 588075e6 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/21 12:44 linux-next 6648e120dd1a 588075e6 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/21 02:15 linux-next 6648e120dd1a 2b497001 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/21 01:00 linux-next 6648e120dd1a 2b497001 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/20 15:18 linux-next 6648e120dd1a aaf59e84 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/20 13:21 linux-next 6648e120dd1a aaf59e84 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/20 04:54 linux-next 6648e120dd1a 02e69052 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/20 01:09 linux-next 6648e120dd1a 02e69052 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/19 23:29 linux-next 6648e120dd1a 02e69052 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/19 22:04 linux-next 6648e120dd1a fe2dc057 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.