]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: protect port for bond_3ad_adapter_speed_changed()
authordingtianhong <dingtianhong@huawei.com>
Fri, 13 Dec 2013 09:29:19 +0000 (17:29 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Dec 2013 21:52:25 +0000 (16:52 -0500)
commitc01072320fb8822c80d6e5c1f8c11928cb0dc78b
treecd55e18def09e35b41e63dd8429beab6dc945dc3
parenta2a2d39a8e20d1efbc4efa0a0626cb494f3336cd
bonding: protect port for bond_3ad_adapter_speed_changed()

Jay Vosburgh said that the bond_3ad_adapter_speed_changed is
called with RTNL only, and the function will modify the port's
information with no further locking, it will not mutex against
bond state machine and incoming LACPDU which do not hold RTNL,
So I add __get_state_machine_lock to protect the port.

But it is not a critical bug, it exist since day one, and till
now it has never been hit and reported, because changes to
speed is very rare, and will not occur critical problem.

The comment in the function is very old, cleanup it.

Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_3ad.c