Skip to contentSkip to conversation

mac80211: fix RCU locking in __ieee80211_rx_handle_packet

PATCH In review Johannes Berg 2 participants 3 messages Jan 17, 2008 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: fix RCU locking in __ieee80211_rx_handle_packet

Commit c7a51bda ("mac80211: restructure __ieee80211_rx") extracted __ieee80211_rx_handle_packet out of __ieee80211_rx and hence changed the locking rules for __ieee80211_rx_handle_packet(), it is now invoked under RCU lock. There is, however, one instance left where it contains an rcu_read_unlock() in an error path, which is a bug.

---
sparse actually detected this.... oh well

 net/mac80211/rx.c |    1 -
 1 file changed, 1 deletion(-)
net/mac80211/rx.c +0 -1
@@ -1730,7 +1730,6 @@ void __ieee80211_rx_handle_packet(struct
 		ieee80211_invoke_rx_handlers(local, local->rx_handlers, &rx,
 					     rx.sta);
 		sta_info_put(sta);
-		rcu_read_unlock();
 		return;
 	}
 
#1 lore raw
Quoted 3 lines

sparse actually detected this.... oh well

Arrrr... i did the re-structuring of Rx flow and forgot to sparse. I'll issue a patch to clean up the warnings.

author maintainer
#2 lore raw
Quoted 6 lines · Ron Rindjunsky
Quoted 3 lines

sparse actually detected this.... oh well

Arrrr... i did the re-structuring of Rx flow and forgot to sparse. I'll issue a patch to clean up the warnings.

No worries, the rest is just harmless missing "static" keywords. I wonder though, should we get rid of that special case completely? Jiri intended this as an 'optimisation' but since we rarely even hit the case (I had to play with monitor interfaces *and* AP mode to hit it!!) it probably hurts performance more by the extra branches and all that. And it makes it harder to verify correctness...

johannes