wifi: mac80211: drop stray 'static' from fast-RX rx_result
Subsystems (2)
PATCH 1/1 wifi: mac80211: drop stray 'static' from fast-RX rx_result
ieee80211_invoke_fast_rx() is documented as safe for parallel RX, but its per-invocation rx_result is declared static. Concurrent callers then share one instance and can overwrite each other's result between ieee80211_rx_mesh_data() and the switch on res.
That can make a packet that was queued or consumed by ieee80211_rx_mesh_data() fall through into ieee80211_rx_8023(), or make a packet that should continue return as queued.
Make res an automatic variable so each invocation keeps its own result.
--- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/rx.c +1 -1
@@ -4971,7 +4971,7 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,struct sk_buff *skb = rx->skb;struct ieee80211_hdr *hdr = (void *)skb->data;struct ieee80211_rx_status *status =IEEE80211_SKB_RXCB (skb); -static ieee80211_rx_result res; +ieee80211_rx_result res;int orig_len = skb->len;int hdrlen =ieee80211_hdrlen (hdr->frame_control);int snap_offs = hdrlen;
Signature · 1 line
2.50.1 (Apple Git-155)
Quoted 5 lines · Catherine
ieee80211_invoke_fast_rx()is documented as safe for parallel RX, but its per-invocationrx_resultis declared static. Concurrent callers then share one instance and can overwrite each other's result betweenieee80211_rx_mesh_data()and the switch on res.
Quoted 7 lines
That can make a packet that was queued or consumed by
ieee80211_rx_mesh_data()fall through intoieee80211_rx_8023(), or make a packet that should continue return as queued.Make res an automatic variable so each invocation keeps its own result.
Fixes 3468e1e0c639 ("wifi: mac80211: add mesh fast-rx support")
@Felix: Any recollection why this was static in your original patch?
Quoted 2 lines
Signed-off-by Catherine <[email protected]>
Is this an identity you commonly use? Note that anonymous contributions are not allowed:
Quoted 9 lines
--- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/mac80211/rx.c +0
-0
net/mac80211/rx.c static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, · line 4977
Quoted 8 lines
net/mac80211/rx.c +1
-1@@ -4971,7 +4971,7 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,struct sk_buff *skb = rx->skb;struct ieee80211_hdr *hdr = (void *)skb->data;struct ieee80211_rx_status *status =IEEE80211_SKB_RXCB (skb); -static ieee80211_rx_result res; +ieee80211_rx_result res;int orig_len = skb->len;int hdrlen =ieee80211_hdrlen (hdr->frame_control);int snap_offs = hdrlen;
Actual patch seem reasonable..
Quoted 4 lines · Jeff Johnson
Is this an identity you commonly use? Note that anonymous contributions are not allowed:
Apologies for the truncated From line. My full name is Zhao Li; I sign other kernel contributions the same way. For DCO purposes, please treat this patch as:
I will use the full name on resends and follow-up patches. Thanks for the review.
--
Zhao Li