Skip to content

Commit

Permalink
net: bridge: vlan: Add a schedule point during VLAN processing
Browse files Browse the repository at this point in the history
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: bdced7e ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
Signed-off-by: Ido Schimmel <[email protected]>
Reported-by: Stefan Priebe - Profihost AG <[email protected]>
Tested-by: Stefan Priebe - Profihost AG <[email protected]>
Acked-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
idosch authored and davem330 committed May 1, 2020
1 parent f9c6cea commit 7979457
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/bridge/br_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7979457

Please sign in to comment.