diff options
author | Ido Schimmel <idosch@mellanox.com> | 2020-04-30 22:38:45 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-30 17:45:41 -0700 |
commit | 7979457b1d3a069cd857f5bd69e070e30223dd0c (patch) | |
tree | 20777cca3412823b63d5c76215cd77c934d2acec /net | |
parent | f9c6cea0b38518741c8dcf26ac056d26ee2fd61d (diff) | |
download | linux-stable-7979457b1d3a069cd857f5bd69e070e30223dd0c.tar.gz linux-stable-7979457b1d3a069cd857f5bd69e070e30223dd0c.tar.bz2 linux-stable-7979457b1d3a069cd857f5bd69e070e30223dd0c.zip |
net: bridge: vlan: Add a schedule point during VLAN processing
User space can request to delete a range of VLANs from a bridge slave in
one netlink request. For each deleted VLAN the FDB needs to be traversed
in order to flush all the affected entries.
If a large range of VLANs is deleted and the number of FDB entries is
large or the FDB lock is contented, it is possible for the kernel to
loop through the deleted VLANs for a long time. In case preemption is
disabled, this can result in a soft lockup.
Fix this by adding a schedule point after each VLAN is deleted to yield
the CPU, if needed. This is safe because the VLANs are traversed in
process context.
Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
Tested-by: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_netlink.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 43dab4066f91..a0f5dbee8f9c 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c @@ -612,6 +612,7 @@ int br_process_vlan_info(struct net_bridge *br, v - 1, rtm_cmd); v_change_start = 0; } + cond_resched(); } /* v_change_start is set only if the last/whole range changed */ if (v_change_start) |