syzbot


possible deadlock in dev_uc_sync_multiple

Status: auto-closed as invalid on 2020/12/15 01:55
Reported-by: syzbot+3c12a1ef2cf446b8d6bc@syzkaller.appspotmail.com
First crash: 1408d, last: 1408d
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in dev_uc_sync_multiple (3) net 1 1392d 1388d 0/27 auto-closed as invalid on 2020/12/31 04:17
linux-4.14 possible deadlock in dev_uc_sync_multiple (3) 1 493d 493d 0/1 upstream: reported on 2023/02/17 11:15
linux-4.19 possible deadlock in dev_uc_sync_multiple (3) C error 7 507d 687d 0/1 upstream: reported C repro on 2022/08/08 00:40
linux-4.19 possible deadlock in dev_uc_sync_multiple (2) 11 825d 1005d 0/1 auto-closed as invalid on 2022/07/21 03:12
upstream possible deadlock in dev_uc_sync_multiple net 1 1928d 1928d 0/27 auto-closed as invalid on 2019/09/11 09:05
upstream possible deadlock in dev_uc_sync_multiple (2) net 26 1446d 1457d 15/27 fixed on 2020/07/20 08:03
linux-4.14 possible deadlock in dev_uc_sync_multiple (2) 9 620d 907d 0/1 auto-obsoleted due to no activity on 2023/02/11 03:42
linux-4.14 possible deadlock in dev_uc_sync_multiple 4 1160d 1393d 0/1 auto-closed as invalid on 2021/08/19 17:04

Sample crash report:
device macsec1 left promiscuous mode
device bond6 left promiscuous mode
8021q: adding VLAN 0 to HW filter on device team0
======================================================
WARNING: possible circular locking dependency detected
4.19.139-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.2/15306 is trying to acquire lock:
00000000c2cb410d (&macsec_netdev_addr_lock_key#2/2){+...}, at: netif_addr_lock_nested include/linux/netdevice.h:3991 [inline]
00000000c2cb410d (&macsec_netdev_addr_lock_key#2/2){+...}, at: dev_uc_sync_multiple+0x11a/0x1e0 net/core/dev_addr_lists.c:574

but task is already holding lock:
00000000b550cc1d (&dev_addr_list_lock_key#2/1){+...}, at: netif_addr_lock_nested include/linux/netdevice.h:3991 [inline]
00000000b550cc1d (&dev_addr_list_lock_key#2/1){+...}, at: dev_mc_sync+0x11a/0x1e0 net/core/dev_addr_lists.c:765

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&dev_addr_list_lock_key#2/1){+...}:
       netif_addr_lock_nested include/linux/netdevice.h:3991 [inline]
       dev_mc_sync+0x11a/0x1e0 net/core/dev_addr_lists.c:765
       macsec_dev_set_rx_mode+0x3b/0x50 drivers/net/macsec.c:2887
       __dev_set_rx_mode+0x1d9/0x2f0 net/core/dev.c:7592
       dev_set_rx_mode net/core/dev.c:7598 [inline]
       __dev_open+0x26c/0x3a0 net/core/dev.c:1410
       __dev_change_flags+0x501/0x660 net/core/dev.c:7670
       rtnl_configure_link+0xec/0x230 net/core/rtnetlink.c:2830
       rtnl_newlink+0x104e/0x15b0 net/core/rtnetlink.c:3161
       rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4778
       netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
       netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
       netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
       netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
       sock_sendmsg_nosec net/socket.c:622 [inline]
       sock_sendmsg+0xc3/0x120 net/socket.c:632
       ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115
       __sys_sendmsg net/socket.c:2153 [inline]
       __do_sys_sendmsg net/socket.c:2162 [inline]
       __se_sys_sendmsg net/socket.c:2160 [inline]
       __x64_sys_sendmsg+0x132/0x220 net/socket.c:2160
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&macsec_netdev_addr_lock_key#2/2){+...}:
       _raw_spin_lock_nested+0x30/0x40 kernel/locking/spinlock.c:354
       netif_addr_lock_nested include/linux/netdevice.h:3991 [inline]
       dev_uc_sync_multiple+0x11a/0x1e0 net/core/dev_addr_lists.c:574
       team_set_rx_mode+0xce/0x230 drivers/net/team/team.c:1788
       __dev_set_rx_mode+0x1d9/0x2f0 net/core/dev.c:7592
       dev_mc_sync+0x193/0x1e0 net/core/dev_addr_lists.c:768
       vlan_dev_set_rx_mode+0x38/0x80 net/8021q/vlan_dev.c:488
       __dev_set_rx_mode+0x1d9/0x2f0 net/core/dev.c:7592
       dev_set_rx_mode net/core/dev.c:7598 [inline]
       __dev_open+0x26c/0x3a0 net/core/dev.c:1410
       __dev_change_flags+0x501/0x660 net/core/dev.c:7670
       dev_change_flags+0x7e/0x140 net/core/dev.c:7739
       vlan_device_event+0x1429/0x1e40 net/8021q/vlan.c:462
       notifier_call_chain+0xc0/0x230 kernel/notifier.c:93
       call_netdevice_notifiers net/core/dev.c:1762 [inline]
       __dev_notify_flags+0x110/0x2b0 net/core/dev.c:7708
       dev_change_flags+0xf0/0x140 net/core/dev.c:7744
       do_setlink+0x14f1/0x3540 net/core/rtnetlink.c:2449
       rtnl_group_changelink net/core/rtnetlink.c:2925 [inline]
       rtnl_newlink+0xbc0/0x15b0 net/core/rtnetlink.c:3083
       rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4778
       netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
       netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
       netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
       netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
       sock_sendmsg_nosec net/socket.c:622 [inline]
       sock_sendmsg+0xc3/0x120 net/socket.c:632
       ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115
       __sys_sendmsg net/socket.c:2153 [inline]
       __do_sys_sendmsg net/socket.c:2162 [inline]
       __se_sys_sendmsg net/socket.c:2160 [inline]
       __x64_sys_sendmsg+0x132/0x220 net/socket.c:2160
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&dev_addr_list_lock_key#2/1);
                               lock(&macsec_netdev_addr_lock_key#2/2);
                               lock(&dev_addr_list_lock_key#2/1);
  lock(&macsec_netdev_addr_lock_key#2/2);

 *** DEADLOCK ***

4 locks held by syz-executor.2/15306:
 #0: 0000000052ca3d20 (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline]
 #0: 0000000052ca3d20 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x3fe/0xb80 net/core/rtnetlink.c:4775
 #1: 00000000e03da9c0 (&vlan_netdev_addr_lock_key#3/4){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline]
 #1: 00000000e03da9c0 (&vlan_netdev_addr_lock_key#3/4){+...}, at: netif_addr_lock_bh include/linux/netdevice.h:3996 [inline]
 #1: 00000000e03da9c0 (&vlan_netdev_addr_lock_key#3/4){+...}, at: dev_set_rx_mode net/core/dev.c:7597 [inline]
 #1: 00000000e03da9c0 (&vlan_netdev_addr_lock_key#3/4){+...}, at: __dev_open+0x264/0x3a0 net/core/dev.c:1410
 #2: 00000000b550cc1d (&dev_addr_list_lock_key#2/1){+...}, at: netif_addr_lock_nested include/linux/netdevice.h:3991 [inline]
 #2: 00000000b550cc1d (&dev_addr_list_lock_key#2/1){+...}, at: dev_mc_sync+0x11a/0x1e0 net/core/dev_addr_lists.c:765
 #3: 0000000052cf8271 (rcu_read_lock){....}, at: team_set_rx_mode+0x0/0x230 drivers/net/team/team.c:509

stack backtrace:
CPU: 0 PID: 15306 Comm: syz-executor.2 Not tainted 4.19.139-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+0x1fc/0x2fe lib/dump_stack.c:118
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1221
 check_prev_add kernel/locking/lockdep.c:1865 [inline]
 check_prevs_add kernel/locking/lockdep.c:1978 [inline]
 validate_chain kernel/locking/lockdep.c:2419 [inline]
 __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3415
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907
 _raw_spin_lock_nested+0x30/0x40 kernel/locking/spinlock.c:354
 netif_addr_lock_nested include/linux/netdevice.h:3991 [inline]
 dev_uc_sync_multiple+0x11a/0x1e0 net/core/dev_addr_lists.c:574
 team_set_rx_mode+0xce/0x230 drivers/net/team/team.c:1788
 __dev_set_rx_mode+0x1d9/0x2f0 net/core/dev.c:7592
 dev_mc_sync+0x193/0x1e0 net/core/dev_addr_lists.c:768
 vlan_dev_set_rx_mode+0x38/0x80 net/8021q/vlan_dev.c:488
 __dev_set_rx_mode+0x1d9/0x2f0 net/core/dev.c:7592
 dev_set_rx_mode net/core/dev.c:7598 [inline]
 __dev_open+0x26c/0x3a0 net/core/dev.c:1410
 __dev_change_flags+0x501/0x660 net/core/dev.c:7670
 dev_change_flags+0x7e/0x140 net/core/dev.c:7739
 vlan_device_event+0x1429/0x1e40 net/8021q/vlan.c:462
 notifier_call_chain+0xc0/0x230 kernel/notifier.c:93
 call_netdevice_notifiers net/core/dev.c:1762 [inline]
 __dev_notify_flags+0x110/0x2b0 net/core/dev.c:7708
 dev_change_flags+0xf0/0x140 net/core/dev.c:7744
 do_setlink+0x14f1/0x3540 net/core/rtnetlink.c:2449
 rtnl_group_changelink net/core/rtnetlink.c:2925 [inline]
 rtnl_newlink+0xbc0/0x15b0 net/core/rtnetlink.c:3083
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4778
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115
 __sys_sendmsg net/socket.c:2153 [inline]
 __do_sys_sendmsg net/socket.c:2162 [inline]
 __se_sys_sendmsg net/socket.c:2160 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2160
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45d239
Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fdffee97c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000002c0c0 RCX: 000000000045d239
RDX: 0000000000000000 RSI: 0000000020000280 RDI: 0000000000000004
RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007fff3831cb5f R14: 00007fdffee989c0 R15: 000000000118cf4c
IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
IPv6: ADDRCONF(NETDEV_CHANGE): bridge0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
xt_CT: netfilter: NOTRACK target is deprecated, use CT instead or upgrade iptables
IPv6: ADDRCONF(NETDEV_UP): bridge0: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
8021q: adding VLAN 0 to HW filter on device bond0
IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready
8021q: adding VLAN 0 to HW filter on device team0
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
ptrace attach of "/root/syz-executor.2"[15438] was attempted by "/root/syz-executor.2"[15440]
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPVS: ftp: loaded support on port[0] = 21
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
IPVS: ftp: loaded support on port[0] = 21
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/17 01:54 linux-4.19.y c14d30dc9987 5ce13532 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.