linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mac80211: tx: do not drop non-robust mgmt to non-MFP stas.
@ 2012-07-04  9:13 Nicolas Cavallari
  2012-07-04  9:35 ` Johannes Berg
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Cavallari @ 2012-07-04  9:13 UTC (permalink / raw)
  To: John W. Linville, Johannes Berg; +Cc: linux-wireless

When drop_unencrypted is enabled and MFP is disabled, non-robust
management frames for not-yet associated STA are dropped  before
being transmitted.

This isn't visible as many management frames sent from  the kernel
have TX_INTFL_DONT_ENCRYPT set and management frames injected from
monitor vifs have TX_CTL_INJECTED set, so are never dropped in the
tx path. But mgmt frames sent from userspace via NL80211_CMD_FRAME
do not have any of these flags, so are dropped.

This patch make it accept non-robust management frames,
but drops non-management frames and robust management frames as usual.

Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>

---

Found this while trying to manage auth  frames in userspace
on a IBSS RSN network.
I'm  a bit surprised that drop_unencrypted is disabled both
in AP and managed mode, but only enabled in IBSS RSN, which
does not support MFP, yet.

patch based on linux-wireless 565e1fc.

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 4990f4f..97682e0 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -545,6 +545,8 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
 	else if (tx->sdata->drop_unencrypted &&
 		 (tx->skb->protocol != tx->sdata->control_port_protocol) &&
 		 !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
+		 (!ieee80211_is_mgmt(hdr->frame_control) ||
+		  ieee80211_is_robust_mgmt_frame(hdr)) &&
 		 (!ieee80211_is_robust_mgmt_frame(hdr) ||
 		  (ieee80211_is_action(hdr->frame_control) &&
 		   tx->sta && test_sta_flag(tx->sta, WLAN_STA_MFP)))) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-07-10 16:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-04  9:13 [PATCH v2] mac80211: tx: do not drop non-robust mgmt to non-MFP stas Nicolas Cavallari
2012-07-04  9:35 ` Johannes Berg
2012-07-04 10:03   ` Nicolas Cavallari
2012-07-04 10:12     ` Johannes Berg
2012-07-04 13:00       ` Nicolas Cavallari
2012-07-04 13:29         ` Johannes Berg
2012-07-04 16:10           ` [PATCH 1/2] mac80211: restructure key selection Nicolas Cavallari
2012-07-04 16:10             ` [PATCHv3 2/2] mac80211: tx: do not drop non-robust mgmt to non-MFP stas Nicolas Cavallari
2012-07-10 16:07             ` [PATCH 1/2] mac80211: restructure key selection Johannes Berg
2012-07-04 13:45         ` [PATCH v2] mac80211: tx: do not drop non-robust mgmt to non-MFP stas Nicolas Cavallari
2012-07-04 17:44         ` Jouni Malinen
2012-07-05  7:55           ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).