diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2019-04-19 09:31:00 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-02 11:02:55 +0300 |
commit | af31849700e4a1d8c65689cd9b23e6621bc387f2 (patch) | |
tree | 465fa0b9cf64ffa4ef569d2cff72e34bfe7aa303 /lib/test_overflow.c | |
parent | dc2b8b627802abcec26bc4bc715fded368849a19 (diff) | |
download | linux-af31849700e4a1d8c65689cd9b23e6621bc387f2.tar.xz |
team: fix possible recursive locking when add slaves
[ Upstream commit 925b0c841e066b488cc3a60272472b2c56300704 ]
If we add a bond device which is already the master of the team interface,
we will hold the team->lock in team_add_slave() first and then request the
lock in team_set_mac_address() again. The functions are called like:
- team_add_slave()
- team_port_add()
- team_port_enter()
- team_modeop_port_enter()
- __set_port_dev_addr()
- dev_set_mac_address()
- bond_set_mac_address()
- dev_set_mac_address()
- team_set_mac_address
Although team_upper_dev_link() would check the upper devices but it is
called too late. Fix it by adding a checking before processing the slave.
v2: Do not split the string in netdev_err()
Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device")
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions