]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: fix EAPoL rekey fail in 802.3 rx path
authorDeren Wu <deren.wu@mediatek.com>
Sat, 12 Feb 2022 16:20:15 +0000 (00:20 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 16 Feb 2022 14:25:02 +0000 (15:25 +0100)
commitab091683c676db859614fb178bb59eda88d55f39
tree91ec97df0645816fb4190e5e0c3b9912c4423e69
parent24f8bc49ed32c112b647e27f369782d225d6c4d8
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 e5da28ed2999 ("mac80211: do not accept/forward
invalid EAPOL frames").

Cc: stable@vger.kernel.org # 5.12+
Fixes: f6502cac5d95 ("mac80211: add rx decapsulation offload support")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
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 <johannes.berg@intel.com>
net/mac80211/rx.c