Skip to contentSkip to conversation

bridge: need to ref count the LLC sap

PATCH Applied Stephen Hemminger 3 participants 3 messages May 23, 2006 – May 24, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

This should go in 2.616.stable and 2.6.17.

net/bridge/br.c +2 -1
@@ -55,7 +55,7 @@ static int __init br_init(void)
 
 static void __exit br_deinit(void)
 {
-	llc_sap_close(br_stp_sap);
+	rcu_assign_pointer(br_stp_sap->rcv_func, NULL);
 
 #ifdef CONFIG_BRIDGE_NETFILTER
 	br_netfilter_fini();
@@ -67,6 +67,7 @@ static void __exit br_deinit(void)
 
 	synchronize_net();
 
+	llc_sap_put(br_stp_sap);
 	br_fdb_get_hook = NULL;
 	br_fdb_put_hook = NULL;
 
maintainer Applied
#1 lore raw

From: Stephen Hemminger <[email protected]>
Subject: [PATCH] bridge: need to ref count the LLC sap
Date: Tue, 23 May 2006 15:10:35 -0700

Quoted 11 lines

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).

This should go in 2.616.stable and 2.6.17.

Applied, thanks a lot.

Please submit to -stable.

#2 lore raw
Quoted 12 lines · David Miller

From: Stephen Hemminger <[email protected]>
Subject: [PATCH] bridge: need to ref count the LLC sap
Date: Tue, 23 May 2006 15:10:35 -0700

Quoted 8 lines

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).

Quoted 7 lines
Quoted 3 lines

This should go in 2.616.stable and 2.6.17.

Applied, thanks a lot.

Please submit to -stable.

Thanks Stephen for the patches, Dave for the quick merge, I'm still out in la la work related land, hope to be back to fun work soon :-)

- Arnaldo