[v6.1] possible deadlock in team_port_change_check

0 views
Skip to first unread message

syzbot

unread,
Apr 1, 2024, 1:20:33 PMApr 1
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e5cd595e23c1 Linux 6.1.83
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16859d29180000
kernel config: https://syzkaller.appspot.com/x/.config?x=99d0cbbc2b2c7cfd
dashboard link: https://syzkaller.appspot.com/bug?extid=4f4f84e5ae7cf9e36cc8
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/607b4730a2cc/disk-e5cd595e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/265e84c69ac5/vmlinux-e5cd595e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/af893c46019b/bzImage-e5cd595e.xz

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

============================================
WARNING: possible recursive locking detected
6.1.83-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.3/10308 is trying to acquire lock:
ffff88807958cd00 (team->team_lock_key#5){+.+.}-{3:3}, at: team_port_change_check+0x51/0x1e0 drivers/net/team/team.c:3010

but task is already holding lock:
ffff88807958cd00 (team->team_lock_key#5){+.+.}-{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#5);
lock(team->team_lock_key#5);

*** DEADLOCK ***

May be due to missing lock nesting notation

2 locks held by syz-executor.3/10308:
#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: ffff88807958cd00 (team->team_lock_key#5){+.+.}-{3:3}, at: team_add_slave+0xab/0x2760 drivers/net/team/team.c:1986

stack backtrace:
CPU: 0 PID: 10308 Comm: syz-executor.3 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+0x1a1/0x570 drivers/net/team/team.c:3036
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_close_many+0x37c/0x530 net/core/dev.c:1570
vlan_device_event+0x1584/0x1d10 net/8021q/vlan.c:449
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_close_many+0x37c/0x530 net/core/dev.c:1570
dev_close+0x1b3/0x2b0 net/core/dev.c:1592
team_port_add drivers/net/team/team.c:1314 [inline]
team_add_slave+0x1a9e/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:0x7fa7c107dda9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa7c1e3f0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fa7c11abf80 RCX: 00007fa7c107dda9
RDX: 0000000000000000 RSI: 0000000020000600 RDI: 0000000000000003
RBP: 00007fa7c10ca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fa7c11abf80 R15: 00007ffe9c1a31f8
</TASK>


---
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.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Apr 1, 2024, 2:17:33 PMApr 1
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: e5cd595e23c1 Linux 6.1.83
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1545bb76180000
kernel config: https://syzkaller.appspot.com/x/.config?x=99d0cbbc2b2c7cfd
dashboard link: https://syzkaller.appspot.com/bug?extid=4f4f84e5ae7cf9e36cc8
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1706b3d9180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14de203d180000
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>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Apr 1, 2024, 3:31:34 PMApr 1
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9465fef4ae35 Linux 5.15.153
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15829a19180000
kernel config: https://syzkaller.appspot.com/x/.config?x=176c746ee3348b33
dashboard link: https://syzkaller.appspot.com/bug?extid=d167aea98ffde47388b5
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1782b3c6180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17fd08a1180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/741f29d5f449/disk-9465fef4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/66645f341114/vmlinux-9465fef4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f7d21e0c9e19/bzImage-9465fef4.xz

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

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>


---
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.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

Reply all
Reply to author
Forward
0 new messages