aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-04-20 15:32:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-27 03:10:38 -0400
commite0411f1eb549a7993c9821c05f1787c0bd1523b4 (patch)
treefb0d929f22fe9a2b4221f7714a83080777e774d1
parentb93858556fd13c76a36a0c110450fa35eadf5671 (diff)
mac80211: reject ToDS broadcast data frames
commit 3018e947d7fd536d57e2b550c33e456d921fff8c upstream. AP/AP_VLAN modes don't accept any real 802.11 multicast data frames, but since they do need to accept broadcast management frames the same is currently permitted for data frames. This opens a security problem because such frames would be decrypted with the GTK, and could even contain unicast L3 frames. Since the spec says that ToDS frames must always have the BSSID as the RA (addr1), reject any other data frames. The problem was originally reported in "Predicting, Decrypting, and Abusing WPA2/802.11 Group Keys" at usenix https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/vanhoef and brought to my attention by Jouni. Reported-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --
-rw-r--r--net/mac80211/rx.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a697ddf56334..e2bbad0e494c 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3617,6 +3617,27 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
3617 !ether_addr_equal(bssid, hdr->addr1)) 3617 !ether_addr_equal(bssid, hdr->addr1))
3618 return false; 3618 return false;
3619 } 3619 }
3620
3621 /*
3622 * 802.11-2016 Table 9-26 says that for data frames, A1 must be
3623 * the BSSID - we've checked that already but may have accepted
3624 * the wildcard (ff:ff:ff:ff:ff:ff).
3625 *
3626 * It also says:
3627 * The BSSID of the Data frame is determined as follows:
3628 * a) If the STA is contained within an AP or is associated
3629 * with an AP, the BSSID is the address currently in use
3630 * by the STA contained in the AP.
3631 *
3632 * So we should not accept data frames with an address that's
3633 * multicast.
3634 *
3635 * Accepting it also opens a security problem because stations
3636 * could encrypt it with the GTK and inject traffic that way.
3637 */
3638 if (ieee80211_is_data(hdr->frame_control) && multicast)
3639 return false;
3640
3620 return true; 3641 return true;
3621 case NL80211_IFTYPE_WDS: 3642 case NL80211_IFTYPE_WDS:
3622 if (bssid || !ieee80211_is_data(hdr->frame_control)) 3643 if (bssid || !ieee80211_is_data(hdr->frame_control))