syzbot


possible deadlock in dev_uc_sync_multiple (2)

Status: auto-closed as invalid on 2022/07/21 03:12
Reported-by: syzbot+feee8061bb44c7cc0e4c@syzkaller.appspotmail.com
First crash: 944d, last: 764d
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 1331d 1327d 0/26 auto-closed as invalid on 2020/12/31 04:17
linux-4.14 possible deadlock in dev_uc_sync_multiple (3) 1 433d 433d 0/1 upstream: reported on 2023/02/17 11:15
linux-4.19 possible deadlock in dev_uc_sync_multiple (3) C error 7 447d 626d 0/1 upstream: reported C repro on 2022/08/08 00:40
upstream possible deadlock in dev_uc_sync_multiple net 1 1868d 1867d 0/26 auto-closed as invalid on 2019/09/11 09:05
upstream possible deadlock in dev_uc_sync_multiple (2) net 26 1385d 1396d 15/26 fixed on 2020/07/20 08:03
linux-4.19 possible deadlock in dev_uc_sync_multiple 1 1347d 1347d 0/1 auto-closed as invalid on 2020/12/15 01:55
linux-4.14 possible deadlock in dev_uc_sync_multiple (2) 9 559d 846d 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 1099d 1332d 0/1 auto-closed as invalid on 2021/08/19 17:04

Sample crash report:
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
8021q: adding VLAN 0 to HW filter on device team0
======================================================
WARNING: possible circular locking dependency detected
4.19.211-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.3/29067 is trying to acquire lock:
00000000077e7f95 (&macvlan_netdev_addr_lock_key#2/2){+...}, at: netif_addr_lock_nested include/linux/netdevice.h:4007 [inline]
00000000077e7f95 (&macvlan_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:
0000000000e41ef1 (&dev_addr_list_lock_key#2/1){+...}, at: netif_addr_lock_nested include/linux/netdevice.h:4007 [inline]
0000000000e41ef1 (&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:4007 [inline]
       dev_uc_sync+0x11a/0x1e0 net/core/dev_addr_lists.c:544
       macvlan_set_mac_lists+0x55/0x110 drivers/net/macvlan.c:806
       __dev_set_rx_mode+0x1d9/0x2f0 net/core/dev.c:7601
       dev_set_rx_mode net/core/dev.c:7607 [inline]
       __dev_open+0x26c/0x3a0 net/core/dev.c:1410
       __dev_change_flags+0x501/0x660 net/core/dev.c:7679
       rtnl_configure_link+0xec/0x230 net/core/rtnetlink.c:2830
       rtnl_newlink+0x1057/0x15c0 net/core/rtnetlink.c:3161
       rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
       netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
       netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
       netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
       netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
       sock_sendmsg_nosec net/socket.c:651 [inline]
       sock_sendmsg+0xc3/0x120 net/socket.c:661
       ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
       __sys_sendmsg net/socket.c:2265 [inline]
       __do_sys_sendmsg net/socket.c:2274 [inline]
       __se_sys_sendmsg net/socket.c:2272 [inline]
       __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&macvlan_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:4007 [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:7601
       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:7601
       dev_set_rx_mode net/core/dev.c:7607 [inline]
       __dev_open+0x26c/0x3a0 net/core/dev.c:1410
       __dev_change_flags+0x501/0x660 net/core/dev.c:7679
       dev_change_flags+0x7e/0x140 net/core/dev.c:7748
       vlan_device_event+0x1429/0x1e40 net/8021q/vlan.c:463
       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:7717
       dev_change_flags+0xf0/0x140 net/core/dev.c:7753
       do_setlink+0x14f1/0x3540 net/core/rtnetlink.c:2449
       rtnl_group_changelink net/core/rtnetlink.c:2925 [inline]
       rtnl_newlink+0xbc9/0x15c0 net/core/rtnetlink.c:3083
       rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
       netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
       netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
       netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
       netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
       sock_sendmsg_nosec net/socket.c:651 [inline]
       sock_sendmsg+0xc3/0x120 net/socket.c:661
       ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
       __sys_sendmsg net/socket.c:2265 [inline]
       __do_sys_sendmsg net/socket.c:2274 [inline]
       __se_sys_sendmsg net/socket.c:2272 [inline]
       __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
       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(&macvlan_netdev_addr_lock_key#2/2);
                               lock(&dev_addr_list_lock_key#2/1);
  lock(&macvlan_netdev_addr_lock_key#2/2);

 *** DEADLOCK ***

4 locks held by syz-executor.3/29067:
 #0: 00000000decc920f (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline]
 #0: 00000000decc920f (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x3fe/0xb80 net/core/rtnetlink.c:4779
 #1: 00000000b803b2a3 (&vlan_netdev_addr_lock_key#2/2){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline]
 #1: 00000000b803b2a3 (&vlan_netdev_addr_lock_key#2/2){+...}, at: netif_addr_lock_bh include/linux/netdevice.h:4012 [inline]
 #1: 00000000b803b2a3 (&vlan_netdev_addr_lock_key#2/2){+...}, at: dev_set_rx_mode net/core/dev.c:7606 [inline]
 #1: 00000000b803b2a3 (&vlan_netdev_addr_lock_key#2/2){+...}, at: __dev_open+0x264/0x3a0 net/core/dev.c:1410
 #2: 0000000000e41ef1 (&dev_addr_list_lock_key#2/1){+...}, at: netif_addr_lock_nested include/linux/netdevice.h:4007 [inline]
 #2: 0000000000e41ef1 (&dev_addr_list_lock_key#2/1){+...}, at: dev_mc_sync+0x11a/0x1e0 net/core/dev_addr_lists.c:765
 #3: 000000005aececb0 (rcu_read_lock){....}, at: team_set_rx_mode+0x0/0x230 drivers/net/team/team.c:509

stack backtrace:
CPU: 1 PID: 29067 Comm: syz-executor.3 Not tainted 4.19.211-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/0x2ef lib/dump_stack.c:118
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222
 check_prev_add kernel/locking/lockdep.c:1866 [inline]
 check_prevs_add kernel/locking/lockdep.c:1979 [inline]
 validate_chain kernel/locking/lockdep.c:2420 [inline]
 __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
 _raw_spin_lock_nested+0x30/0x40 kernel/locking/spinlock.c:354
 netif_addr_lock_nested include/linux/netdevice.h:4007 [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:7601
 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:7601
 dev_set_rx_mode net/core/dev.c:7607 [inline]
 __dev_open+0x26c/0x3a0 net/core/dev.c:1410
 __dev_change_flags+0x501/0x660 net/core/dev.c:7679
 dev_change_flags+0x7e/0x140 net/core/dev.c:7748
 vlan_device_event+0x1429/0x1e40 net/8021q/vlan.c:463
 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:7717
 dev_change_flags+0xf0/0x140 net/core/dev.c:7753
 do_setlink+0x14f1/0x3540 net/core/rtnetlink.c:2449
 rtnl_group_changelink net/core/rtnetlink.c:2925 [inline]
 rtnl_newlink+0xbc9/0x15c0 net/core/rtnetlink.c:3083
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f0e3053d049
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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:00007f0e2eeb2168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f0e3064ff60 RCX: 00007f0e3053d049
RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000003
RBP: 00007f0e3059708d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd89f0f7af R14: 00007f0e2eeb2300 R15: 0000000000022000
IPv6: ADDRCONF(NETDEV_UP): team0.4094: link is not 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): team0.4094: link becomes ready
TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
hub 9-0:1.0: USB hub found
hub 9-0:1.0: 8 ports detected
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
usb usb9: usbfs: interface 0 claimed by hub while 'syz-executor.2' sets config #0
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.
usb usb9: usbfs: interface 0 claimed by usbfs while 'syz-executor.2' sets config #1
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
IPv6: ADDRCONF(NETDEV_UP): team0.4094: link is not ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
hub 9-0:1.0: USB hub found
hub 9-0:1.0: 8 ports detected
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): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready
team0: Device ipip0 is of different type
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
usb usb9: usbfs: interface 0 claimed by hub while 'syz-executor.2' sets config #0
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.
usb usb9: usbfs: interface 0 claimed by usbfs while 'syz-executor.2' sets config #1
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.
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready
team0: Device ipip0 is of different type
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.
team0: Device ipip0 is of different type
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
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready
overlayfs: './file0' not a directory
team0: Device ipip0 is of different type
overlayfs: fs on './file0' does not support file handles, falling back to index=off,nfs_export=off.
team0: Device ipip0 is of different type
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready
overlayfs: fs on './file0' does not support file handles, falling back to index=off,nfs_export=off.
team0: Device ipip0 is of different type
overlayfs: fs on './file0' does not support file handles, falling back to index=off,nfs_export=off.
team0: Device ipip0 is of different type
netlink: 'syz-executor.2': attribute type 1 has an invalid length.
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
overlayfs: overlapping lowerdir path
overlayfs: overlapping lowerdir path
overlayfs: overlapping lowerdir path
mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium
overlayfs: overlapping lowerdir path
kauditd_printk_skb: 1 callbacks suppressed
audit: type=1800 audit(1648005091.277:191): pid=29626 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=14419 res=0
audit: type=1804 audit(1648005091.277:192): pid=29626 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.4" name="/root/syzkaller-testdir610704873/syzkaller.oBXI1T/659/bus" dev="sda1" ino=14419 res=1
mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium
audit: type=1800 audit(1648005091.997:193): pid=29655 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=14340 res=0
audit: type=1804 audit(1648005092.057:194): pid=29655 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.4" name="/root/syzkaller-testdir610704873/syzkaller.oBXI1T/660/bus" dev="sda1" ino=14340 res=1
audit: type=1800 audit(1648005092.187:195): pid=29660 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.0" name="bus" dev="sda1" ino=13937 res=0

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/23 03:11 linux-4.19.y 3f8a27f9e27b 5ff41e94 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2022/03/16 15:31 linux-4.19.y 3f8a27f9e27b 46cc3b21 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2022/03/10 23:48 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2022/03/09 07:30 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2022/02/23 07:53 linux-4.19.y 3f8a27f9e27b 6e821dbf .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2022/02/20 05:06 linux-4.19.y 3f8a27f9e27b 3cd800e4 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2022/02/19 02:13 linux-4.19.y 3f8a27f9e27b 3cd800e4 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2022/02/08 00:00 linux-4.19.y 3f8a27f9e27b a7dab638 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2021/12/20 09:49 linux-4.19.y 3f8a27f9e27b 021b36cb .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2021/10/17 21:31 linux-4.19.y 3f8a27f9e27b 0c5d9412 .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
2021/09/24 01:13 linux-4.19.y 2950c9c5e0df 8cac236e .config console log report info ci2-linux-4-19 possible deadlock in dev_uc_sync_multiple
* Struck through repros no longer work on HEAD.