syzbot


possible deadlock in team_port_change_check

Status: upstream: reported C repro on 2024/04/01 17:20
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+4f4f84e5ae7cf9e36cc8@syzkaller.appspotmail.com
First crash: 32d, last: 17d
Bug presence (1)
Date Name Commit Repro Result
2024/04/30 upstream (ToT) 98369dccd2f8 C [report] possible deadlock in team_port_change_check
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in team_port_change_check net 2 1459d 1523d 0/26 auto-closed as invalid on 2020/09/02 22:06
linux-5.15 possible deadlock in team_port_change_check origin:upstream C 1 23h24m 32d 0/3 upstream: reported C repro on 2024/04/01 19:31
upstream possible deadlock in team_port_change_check (2) net C done 36 1d18h 64d 0/26 upstream: reported C repro on 2024/02/29 16:02

Sample crash report:
netdevsim netdevsim0 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0
netlink: 'syz-executor358': attribute type 10 has an invalid length.
team0: Port device vlan0 added
netlink: 'syz-executor358': attribute type 10 has an invalid length.
device veth0_vlan left promiscuous mode
device veth0_vlan entered promiscuous mode
============================================
WARNING: possible recursive locking detected
6.1.83-syzkaller #0 Not tainted
--------------------------------------------
syz-executor358/3542 is trying to acquire lock:
ffff888077ddcd00 (team->team_lock_key){+.+.}-{3:3}, at: team_port_change_check+0x51/0x1e0 drivers/net/team/team.c:3010

but task is already holding lock:
ffff888077ddcd00 (team->team_lock_key){+.+.}-{3:3}, at: team_add_slave+0xab/0x2760 drivers/net/team/team.c:1986

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

       CPU0
       ----
  lock(team->team_lock_key);
  lock(team->team_lock_key);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by syz-executor358/3542:
 #0: ffffffff8e2991e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:74 [inline]
 #0: ffffffff8e2991e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x7c1/0xff0 net/core/rtnetlink.c:6118
 #1: ffff888077ddcd00 (team->team_lock_key){+.+.}-{3:3}, at: team_add_slave+0xab/0x2760 drivers/net/team/team.c:1986

stack backtrace:
CPU: 0 PID: 3542 Comm: syz-executor358 Not tainted 6.1.83-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2983 [inline]
 check_deadlock kernel/locking/lockdep.c:3026 [inline]
 validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
 team_port_change_check+0x51/0x1e0 drivers/net/team/team.c:3010
 team_device_event+0x4ac/0x570 drivers/net/team/team.c:3033
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455
 __dev_notify_flags+0x304/0x610
 dev_change_flags+0xe7/0x190 net/core/dev.c:8661
 vlan_device_event+0x429/0x1d10 net/8021q/vlan.c:468
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455
 call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
 call_netdevice_notifiers net/core/dev.c:2022 [inline]
 dev_open+0x1c1/0x260 net/core/dev.c:1498
 team_port_add drivers/net/team/team.c:1217 [inline]
 team_add_slave+0x96e/0x2760 drivers/net/team/team.c:1987
 do_set_master net/core/rtnetlink.c:2598 [inline]
 do_setlink+0xe99/0x3e30 net/core/rtnetlink.c:2808
 __rtnl_newlink net/core/rtnetlink.c:3576 [inline]
 rtnl_newlink+0x172c/0x2050 net/core/rtnetlink.c:3623
 rtnetlink_rcv_msg+0x818/0xff0 net/core/rtnetlink.c:6121
 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2508
 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
 netlink_unicast+0x7d8/0x970 net/netlink/af_netlink.c:1352
 netlink_sendmsg+0xa26/0xd60 net/netlink/af_netlink.c:1874
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x5a5/0x8f0 net/socket.c:2514
 ___sys_sendmsg net/socket.c:2568 [inline]
 __sys_sendmsg+0x2a9/0x390 net/socket.c:2597
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f16cab86b09
Code: 48 83 c4 28 c3 e8 d7 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd3aef4d68 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f16cabd43d3 RCX: 00007f16cab86b09
RDX: 0000000000000000 RSI: 0000000020000600 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffd3aef4da0
R13: 00007f16cabd4004 R14: 00007ffd3aef4d8c R15: 0000000000000003
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/01 18:16 linux-6.1.y e5cd595e23c1 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in team_port_change_check
2024/04/16 14:31 linux-6.1.y cd5d98c0556c 0d592ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in team_port_change_check
2024/04/16 08:12 linux-6.1.y cd5d98c0556c 0d592ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in team_port_change_check
2024/04/01 17:20 linux-6.1.y e5cd595e23c1 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in team_port_change_check
* Struck through repros no longer work on HEAD.