developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame^] | 1 | From: Deren Wu <deren.wu@mediatek.com> |
| 2 | Date: Sun, 13 Feb 2022 00:20:15 +0800 |
| 3 | Subject: [PATCH] mac80211: fix EAPoL rekey fail in 802.3 rx path |
| 4 | |
| 5 | mac80211 set capability NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211 |
| 6 | to upper layer by default. That means we should pass EAPoL packets through |
| 7 | nl80211 path only, and should not send the EAPoL skb to netdevice diretly. |
| 8 | At the meanwhile, wpa_supplicant would not regist sock to listen EAPoL skb |
| 9 | on the netdevice. |
| 10 | |
| 11 | However, there is no contorl_port_protocol handler in mac80211 for 802.3 RX |
| 12 | packets, mac80211 driver would pass up the EAPoL rekey frame to netdevice |
| 13 | and wpa_supplicant would be never interactive with this kind of packets, |
| 14 | if SUPPORTS_RX_DECAP_OFFLOAD is enabled. This causes STA always rekey fail |
| 15 | if EAPoL frame go through 802.3 path. |
| 16 | |
| 17 | To avoid this problem, align the same process as 802.11 type to handle |
| 18 | this frame before put it into network stack. |
| 19 | |
| 20 | Fixes: 80a915ec4427 ("mac80211: add rx decapsulation offload support") |
| 21 | Signed-off-by: Deren Wu <deren.wu@mediatek.com> |
| 22 | --- |
| 23 | |
| 24 | --- a/net/mac80211/rx.c |
| 25 | +++ b/net/mac80211/rx.c |
| 26 | @@ -4523,16 +4523,7 @@ static void ieee80211_rx_8023(struct iee |
| 27 | |
| 28 | /* deliver to local stack */ |
| 29 | skb->protocol = eth_type_trans(skb, fast_rx->dev); |
| 30 | - memset(skb->cb, 0, sizeof(skb->cb)); |
| 31 | - if (rx->list) |
| 32 | -#if LINUX_VERSION_IS_GEQ(4,19,0) |
| 33 | - list_add_tail(&skb->list, rx->list); |
| 34 | -#else |
| 35 | - __skb_queue_tail(rx->list, skb); |
| 36 | -#endif |
| 37 | - else |
| 38 | - netif_receive_skb(skb); |
| 39 | - |
| 40 | + ieee80211_deliver_skb_to_local_stack(skb, rx); |
| 41 | } |
| 42 | |
| 43 | static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, |