From patchwork Wed Jul 4 16:10:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 1156771 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 BFD863FC36 for ; Wed, 4 Jul 2012 16:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754486Ab2GDQLp (ORCPT ); Wed, 4 Jul 2012 12:11:45 -0400 Received: from smtp2.u-psud.fr ([129.175.33.42]:13205 "EHLO smtp2.u-psud.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754016Ab2GDQLp (ORCPT ); Wed, 4 Jul 2012 12:11:45 -0400 Received: from smtp2.u-psud.fr (localhost [127.0.0.1]) by localhost (MTA) with SMTP id 62A9034D6B7; Wed, 4 Jul 2012 18:11:44 +0200 (CEST) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by smtp2.u-psud.fr (MTA) with ESMTP id 45F9E34D69B; Wed, 4 Jul 2012 18:11:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id 459E54097B; Wed, 4 Jul 2012 18:11:44 +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 BXbBlk1IQpOQ; Wed, 4 Jul 2012 18:11:44 +0200 (CEST) Received: from smtp-ng.lri.fr (smtp [129.175.3.73]) by ext.lri.fr (Postfix) with ESMTP id 2707D40512; Wed, 4 Jul 2012 18:11:44 +0200 (CEST) Received: from lowerbit.lri.fr (lri25-36 [129.175.25.36]) by smtp-ng.lri.fr (Postfix) with ESMTP id 1C32460D67; Wed, 4 Jul 2012 18:11:44 +0200 (CEST) From: Nicolas Cavallari To: "John W. Linville" , Johannes Berg Cc: linux-wireless@vger.kernel.org Subject: [PATCHv3 2/2] mac80211: tx: do not drop non-robust mgmt to non-MFP stas. Date: Wed, 4 Jul 2012 18:10:08 +0200 Message-Id: <1341418208-28663-2-git-send-email-cavallar@lri.fr> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1341418208-28663-1-git-send-email-cavallar@lri.fr> References: <1341408545.12432.10.camel@jlt3.sipsolutions.net> <1341418208-28663-1-git-send-email-cavallar@lri.fr> 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. This isn't visible as many management frames sent from the kernel have TX_INTFL_DONT_ENCRYPT set and management frames injected from a monitor vif have TX_CTL_INJECTED so aren't dropped. But management frames sent from userspace via NL80211_CMD_FRAME do not have this flag set, so are dropped. This patch make it always accept non-robust management frames. Signed-off-by: Nicolas Cavallari --- changes : v2->v3 : now depends on johannes's cleanup, even clearer code. v1->v2 : thinier, clearer, more correct code. migrated from RFC to PATCH. --- net/mac80211/tx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index cdd4ac6..691aa6c 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -552,6 +552,9 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) !(ieee80211_is_action(hdr->frame_control) && tx->sta && test_sta_flag(tx->sta, WLAN_STA_MFP))) tx->key = NULL; + else if (ieee80211_is_mgmt(hdr->frame_control) && + !ieee80211_is_robust_mgmt_frame(hdr)) + tx->key = NULL; else { I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); return TX_DROP;