From: Johannes Berg Date: Wed, 28 Nov 2007 10:07:57 +0000 (+0100) Subject: mac80211: drop unencrypted frames if encryption is expected X-Git-Tag: v2.6.24-rc4~8^2~8^2~2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=8312512e81ab16d845b49d1ec695fad1c72f19f6;p=~emulex%2Finfiniband.git mac80211: drop unencrypted frames if encryption is expected This patch fixes a regression I (most likely) introduced, namely that unencrypted frames are right now accepted even if we have a key for that specific sender. That has very bad security implications. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 428a9fcf57d..00f908d9275 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -997,7 +997,7 @@ ieee80211_rx_h_drop_unencrypted(struct ieee80211_txrx_data *rx) if (unlikely(!(rx->fc & IEEE80211_FCTL_PROTECTED) && (rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA && (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_NULLFUNC && - rx->sdata->drop_unencrypted && + (rx->key || rx->sdata->drop_unencrypted) && (rx->sdata->eapol == 0 || !ieee80211_is_eapol(rx->skb)))) { if (net_ratelimit()) printk(KERN_DEBUG "%s: RX non-WEP frame, but expected "