Re: [PATCH net] rtnetlink: fix possible deadlock in team_port_change_check

From: Jeongjun Park
Date: Tue Jul 30 2024 - 21:38:03 EST




> 2024. 7. 31. 오전 8:59, Jakub Kicinski <kuba@xxxxxxxxxx> 작성:
>
> On Wed, 31 Jul 2024 00:22:10 +0900 Jeongjun Park wrote:
>> do_setlink() changes the flag of the device and then enslaves it. However,
>> in this case, if the IFF_UP flag is set, the enslavement process calls
>> team_add_slave() to acquire 'team->lock', but when dev_open() opens the
>> newly enslaved device, the NETDEV_UP event occurs, and as a result,
>> a deadlock occurs when team_port_change_check() tries to acquire
>> 'team->lock' again.
>
> You can't change behavior like this, see ec4ffd100ffb396ec

Okay. In that case, I'll write a patch that modifies the code of the team driver and send
it back to you.

Regards,
Jeongjun Park