Skip to content

Commit 610d086

Browse files
derenjmberg-intel
authored andcommitted
mac80211: fix EAPoL rekey fail in 802.3 rx path
mac80211 set capability NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211 to upper layer by default. That means we should pass EAPoL packets through nl80211 path only, and should not send the EAPoL skb to netdevice diretly. At the meanwhile, wpa_supplicant would not register sock to listen EAPoL skb on the netdevice. However, there is no control_port_protocol handler in mac80211 for 802.3 RX packets, mac80211 driver would pass up the EAPoL rekey frame to netdevice and wpa_supplicant would be never interactive with this kind of packets, if SUPPORTS_RX_DECAP_OFFLOAD is enabled. This causes STA always rekey fail if EAPoL frame go through 802.3 path. To avoid this problem, align the same process as 802.11 type to handle this frame before put it into network stack. This also addresses a potential security issue in 802.3 RX mode that was previously fixed in commit a8c4d76 ("mac80211: do not accept/forward invalid EAPOL frames"). Cc: [email protected] # 5.12+ Fixes: 80a915e ("mac80211: add rx decapsulation offload support") Signed-off-by: Deren Wu <[email protected]> Link: https://lore.kernel.org/r/6889c9fced5859ebb088564035f84fd0fa792a49.1644680751.git.deren.wu@mediatek.com [fix typos, update comment and add note about security issue] Signed-off-by: Johannes Berg <[email protected]>
1 parent bf8e59f commit 610d086

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

net/mac80211/rx.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,7 +2607,8 @@ static void ieee80211_deliver_skb_to_local_stack(struct sk_buff *skb,
26072607
* address, so that the authenticator (e.g. hostapd) will see
26082608
* the frame, but bridge won't forward it anywhere else. Note
26092609
* that due to earlier filtering, the only other address can
2610-
* be the PAE group address.
2610+
* be the PAE group address, unless the hardware allowed them
2611+
* through in 802.3 offloaded mode.
26112612
*/
26122613
if (unlikely(skb->protocol == sdata->control_port_protocol &&
26132614
!ether_addr_equal(ehdr->h_dest, sdata->vif.addr)))
@@ -4514,12 +4515,7 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
45144515

45154516
/* deliver to local stack */
45164517
skb->protocol = eth_type_trans(skb, fast_rx->dev);
4517-
memset(skb->cb, 0, sizeof(skb->cb));
4518-
if (rx->list)
4519-
list_add_tail(&skb->list, rx->list);
4520-
else
4521-
netif_receive_skb(skb);
4522-
4518+
ieee80211_deliver_skb_to_local_stack(skb, rx);
45234519
}
45244520

45254521
static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,

0 commit comments

Comments
 (0)