Skip to content

Commit 387e2b0

Browse files
Stephen Hemmingerdavem330
authored andcommitted
[BRIDGE]: need to ref count the LLC sap
Bridge will OOPS on removal if other application has the SAP open. The bridge SAP might be shared with other usages, so need to do reference counting on module removal rather than explicit close/delete. Since packet might arrive after or during removal, need to clear the receive function handle, so LLC only hands it to user (if any). Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4a06373 commit 387e2b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/bridge/br.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int __init br_init(void)
5555

5656
static void __exit br_deinit(void)
5757
{
58-
llc_sap_close(br_stp_sap);
58+
rcu_assign_pointer(br_stp_sap->rcv_func, NULL);
5959

6060
#ifdef CONFIG_BRIDGE_NETFILTER
6161
br_netfilter_fini();
@@ -67,6 +67,7 @@ static void __exit br_deinit(void)
6767

6868
synchronize_net();
6969

70+
llc_sap_put(br_stp_sap);
7071
br_fdb_get_hook = NULL;
7172
br_fdb_put_hook = NULL;
7273

0 commit comments

Comments
 (0)