diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-09-17 11:15:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-07 16:02:15 -0700 |
commit | 40dccfb2259f13eed66993a0d9b153e0695c8504 (patch) | |
tree | 881d39b12de63035f41ea9834b3585727d4407d7 | |
parent | 595cfbc5ae5bfaefa29b57a3f4dec04b76e108c5 (diff) |
mac80211: drop spoofed packets in ad-hoc mode
commit 6329b8d917adc077caa60c2447385554130853a3 upstream.
If an Ad-Hoc node receives packets with the Cell ID or its own MAC
address as source address, it hits a WARN_ON in sta_info_insert_check()
With many packets, this can massively spam the logs. One way that this
can easily happen is through having Cisco APs in the area with rouge AP
detection and countermeasures enabled.
Such Cisco APs will regularly send fake beacons, disassoc and deauth
packets that trigger these warnings.
To fix this issue, drop such spoofed packets early in the rx path.
Reported-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[bwh: Backported to 3.2: use compare_ether_addr() instead of ether_addr_equal()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/mac80211/rx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 6937a84bef3..f5ed8638855 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2828,6 +2828,9 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, case NL80211_IFTYPE_ADHOC: if (!bssid) return 0; + if (compare_ether_addr(sdata->vif.addr, hdr->addr2) == 0 || + compare_ether_addr(sdata->u.ibss.bssid, hdr->addr2) == 0) + return 0; if (ieee80211_is_beacon(hdr->frame_control)) { return 1; } |