Skip to content

Commit 9a8a181

Browse files
YueHaibinggregkh
YueHaibing
authored andcommitted
mac80211: Drop frames from invalid MAC address in ad-hoc mode
[ Upstream commit a6555f8 ] WARNING: CPU: 1 PID: 9 at net/mac80211/sta_info.c:554 sta_info_insert_rcu+0x121/0x12a0 Modules linked in: CPU: 1 PID: 9 Comm: kworker/u8:1 Not tainted 5.14.0-rc7+ #253 Workqueue: phy3 ieee80211_iface_work RIP: 0010:sta_info_insert_rcu+0x121/0x12a0 ... Call Trace: ieee80211_ibss_finish_sta+0xbc/0x170 ieee80211_ibss_work+0x13f/0x7d0 ieee80211_iface_work+0x37a/0x500 process_one_work+0x357/0x850 worker_thread+0x41/0x4d0 If an Ad-Hoc node receives packets with invalid source MAC address, it hits a WARN_ON in sta_info_insert_check(), this can spam the log. Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a3ea231 commit 9a8a181

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/mac80211/rx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4053,7 +4053,8 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
40534053
if (!bssid)
40544054
return false;
40554055
if (ether_addr_equal(sdata->vif.addr, hdr->addr2) ||
4056-
ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2))
4056+
ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2) ||
4057+
!is_valid_ether_addr(hdr->addr2))
40574058
return false;
40584059
if (ieee80211_is_beacon(hdr->frame_control))
40594060
return true;

0 commit comments

Comments
 (0)