syzbot


possible deadlock in team_port_change_check

Status: upstream: reported C repro on 2024/04/01 19:31
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+d167aea98ffde47388b5@syzkaller.appspotmail.com
First crash: 196d, last: 10d
Bug presence (1)
Date Name Commit Repro Result
2024/05/02 upstream (ToT) 0106679839f7 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 1623d 1687d 0/28 auto-closed as invalid on 2020/09/02 22:06
upstream possible deadlock in team_port_change_check (2) net C done 1586 44m 228d 0/28 upstream: reported C repro on 2024/02/29 16:02
linux-6.1 possible deadlock in team_port_change_check origin:upstream C 14 4d06h 196d 0/3 upstream: reported C repro on 2024/04/01 17:20
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/10/01 05:49 1h21m bisect fix linux-5.15.y OK (0) job log log
2024/08/23 17:42 1h23m bisect fix linux-5.15.y OK (0) job log log
2024/05/02 22:51 2h29m bisect fix linux-5.15.y OK (0) job log log

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

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

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-executor708/3507:
 #0: ffffffff8d9dc108 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:72 [inline]
 #0: ffffffff8d9dc108 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x94c/0xee0 net/core/rtnetlink.c:5626
 #1: ffff88807a5a0d00 (team->team_lock_key){+.+.}-{3:3}, at: team_add_slave+0xab/0x27a0 drivers/net/team/team.c:1981

stack backtrace:
CPU: 1 PID: 3507 Comm: syz-executor708 Not tainted 5.15.153-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:2946 [inline]
 check_deadlock kernel/locking/lockdep.c:2989 [inline]
 validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 team_port_change_check+0x51/0x1e0 drivers/net/team/team.c:3004
 team_device_event+0x4a7/0x580 drivers/net/team/team.c:3027
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 __dev_notify_flags+0x304/0x610
 dev_change_flags+0xe7/0x190 net/core/dev.c:8889
 vlan_device_event+0x442/0x1dd0 net/8021q/vlan.c:469
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2018 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2030 [inline]
 call_netdevice_notifiers net/core/dev.c:2044 [inline]
 dev_open+0x1c1/0x260 net/core/dev.c:1547
 team_port_add drivers/net/team/team.c:1212 [inline]
 team_add_slave+0x981/0x27a0 drivers/net/team/team.c:1982
 do_set_master net/core/rtnetlink.c:2543 [inline]
 do_setlink+0xe71/0x3ae0 net/core/rtnetlink.c:2748
 __rtnl_newlink net/core/rtnetlink.c:3429 [inline]
 rtnl_newlink+0x17a4/0x2070 net/core/rtnetlink.c:3549
 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5629
 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2505
 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
 netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1924
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2431
 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2485
 __sys_sendmsg net/socket.c:2514 [inline]
 __do_sys_sendmsg net/socket.c:2523 [inline]
 __se_sys_sendmsg+0x19a/0x260 net/socket.c:2521
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f2ce708ab09
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:00007ffdc2ecb948 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f2ce70d83d3 RCX: 00007f2ce708ab09
RDX: 0000000000000000 RSI: 0000000020000600 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffdc2ecb980
R13: 00007f2ce70d8004 R14: 00007ffdc2ecb96c R15: 0000000000000003
 </TASK>

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/01 19:31 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in team_port_change_check
2024/10/05 12:28 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in team_port_change_check
2024/07/18 13:39 linux-5.15.y 7c6d66f0266f 71884c12 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in team_port_change_check
2024/07/16 18:37 linux-5.15.y f45bea23c39c b66b37bd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in team_port_change_check
2024/07/15 19:54 linux-5.15.y f45bea23c39c e8709b21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in team_port_change_check
2024/07/15 19:54 linux-5.15.y f45bea23c39c e8709b21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in team_port_change_check
2024/07/08 13:36 linux-5.15.y f45bea23c39c cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in team_port_change_check
2024/06/20 20:49 linux-5.15.y 4878aadf2d15 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in team_port_change_check
2024/07/24 11:01 linux-5.15.y 7c6d66f0266f 57b2edb1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in team_port_change_check
2024/07/11 20:53 linux-5.15.y f45bea23c39c eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in team_port_change_check
2024/05/15 22:10 linux-5.15.y 284087d4f7d5 94b087b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in team_port_change_check
2024/05/10 06:25 linux-5.15.y 284087d4f7d5 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in team_port_change_check
* Struck through repros no longer work on HEAD.