possible deadlock in dev_uc_sync

4 views
Skip to first unread message

syzbot

unread,
Aug 4, 2020, 6:24:17 AM8/4/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 13af6c74 Linux 4.19.136
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11a0212a900000
kernel config: https://syzkaller.appspot.com/x/.config?x=5b7578d3b5457a49
dashboard link: https://syzkaller.appspot.com/bug?extid=6579928b65a528cd8b78
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+657992...@syzkaller.appspotmail.com

device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
======================================================
WARNING: possible circular locking dependency detected
4.19.136-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.3/31530 is trying to acquire lock:
00000000736e05db (&dev_addr_list_lock_key#2/1){+...}, at: netif_addr_lock_nested include/linux/netdevice.h:3991 [inline]
00000000736e05db (&dev_addr_list_lock_key#2/1){+...}, at: dev_uc_sync+0x11a/0x1e0 net/core/dev_addr_lists.c:544

but task is already holding lock:
00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline]
00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: netif_addr_lock_bh include/linux/netdevice.h:3996 [inline]
00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: dev_set_rx_mode net/core/dev.c:7597 [inline]
00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: __dev_open+0x264/0x3a0 net/core/dev.c:1410

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&macvlan_netdev_addr_lock_key#2/2){+...}:
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_uc_sync+0x193/0x1e0 net/core/dev_addr_lists.c:547
macvlan_set_mac_lists+0x55/0x110 drivers/net/macvlan.c:806
__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 (&dev_addr_list_lock_key#2/1){+...}:
_raw_spin_lock_nested+0x30/0x40 kernel/locking/spinlock.c:354
netif_addr_lock_nested include/linux/netdevice.h:3991 [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: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

other info that might help us debug this:

Possible unsafe locking scenario:

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

*** DEADLOCK ***

2 locks held by syz-executor.3/31530:
#0: 0000000067b9e03a (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline]
#0: 0000000067b9e03a (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x3fe/0xb80 net/core/rtnetlink.c:4775
#1: 00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline]
#1: 00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: netif_addr_lock_bh include/linux/netdevice.h:3996 [inline]
#1: 00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: dev_set_rx_mode net/core/dev.c:7597 [inline]
#1: 00000000235295eb (&macvlan_netdev_addr_lock_key#2/2){+...}, at: __dev_open+0x264/0x3a0 net/core/dev.c:1410

stack backtrace:
CPU: 0 PID: 31530 Comm: syz-executor.3 Not tainted 4.19.136-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+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: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
RIP: 0033:0x45cce9
Code: 2d b6 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 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f2560fdec78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000002c080 RCX: 000000000045cce9
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000004
RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c
R13: 00007ffce7b4fa0f R14: 00007f2560fdf9c0 R15: 000000000078bf0c
device macvtap0 entered promiscuous mode
device team0 entered promiscuous mode
8021q: adding VLAN 0 to HW filter on device macvtap0
device macvtap1 entered promiscuous mode
8021q: adding VLAN 0 to HW filter on device macvtap1
netlink: 40 bytes leftover after parsing attributes in process `syz-executor.5'.
Invalid UDP bearer configuration
Enabling of bearer <udp:syz1> rejected, failed to enable media
device macvtap1 entered promiscuous mode
8021q: adding VLAN 0 to HW filter on device macvtap1
device macvtap2 entered promiscuous mode
8021q: adding VLAN 0 to HW filter on device macvtap2
device macvtap2 entered promiscuous mode
8021q: adding VLAN 0 to HW filter on device macvtap2
device macvtap3 entered promiscuous mode
8021q: adding VLAN 0 to HW filter on device macvtap3
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
nla_parse: 5 callbacks suppressed
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'.
overlayfs: upperdir is in-use as upperdir/workdir of another mount, mount with '-o index=off' to override exclusive upperdir protection.


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Dec 2, 2020, 5:24:17 AM12/2/20
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages