From patchwork Wed Jul 4 09:13:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 1155311 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id BC2CB3FE4F for ; Wed, 4 Jul 2012 09:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370Ab2GDJNx (ORCPT ); Wed, 4 Jul 2012 05:13:53 -0400 Received: from smtp2.u-psud.fr ([129.175.33.42]:27840 "EHLO smtp2.u-psud.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753035Ab2GDJNw (ORCPT ); Wed, 4 Jul 2012 05:13:52 -0400 Received: from smtp2.u-psud.fr (localhost [127.0.0.1]) by localhost (MTA) with SMTP id 3793F34CB84; Wed, 4 Jul 2012 11:13:51 +0200 (CEST) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by smtp2.u-psud.fr (MTA) with ESMTP id 1880334CBCB; Wed, 4 Jul 2012 11:13:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id 18D833FEF7; Wed, 4 Jul 2012 11:13:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at lri.fr Received: from ext.lri.fr ([127.0.0.1]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iecp9p4feq+c; Wed, 4 Jul 2012 11:13:50 +0200 (CEST) Received: from smtp-ng.lri.fr (smtp [129.175.3.73]) by ext.lri.fr (Postfix) with ESMTP id EED7A3FEA1; Wed, 4 Jul 2012 11:13:50 +0200 (CEST) Received: from lowerbit.lri.fr (lri25-36 [129.175.25.36]) by smtp-ng.lri.fr (Postfix) with ESMTP id E4BE6606C9; Wed, 4 Jul 2012 11:13:50 +0200 (CEST) From: Nicolas Cavallari To: "John W. Linville" , Johannes Berg Cc: linux-wireless@vger.kernel.org Subject: [PATCH v2] mac80211: tx: do not drop non-robust mgmt to non-MFP stas. Date: Wed, 4 Jul 2012 11:13:41 +0200 Message-Id: <1341393221-5396-1-git-send-email-cavallar@lri.fr> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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)))) {