Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3424093rdh; Thu, 28 Sep 2023 11:07:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0Fc8diCacpShCMnvAkq/D5pfkFL+ct9e0SN9rIFWK42HceWgCoIjJOajrvglnwvnnrdfO X-Received: by 2002:a17:903:120e:b0:1c3:92de:1b23 with SMTP id l14-20020a170903120e00b001c392de1b23mr2096966plh.59.1695924462633; Thu, 28 Sep 2023 11:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695924462; cv=none; d=google.com; s=arc-20160816; b=onEyuJfuVYVPNbcFPqsTcHL4opT38xg680sTdBymtHNlm5L8iXdWPvbWdI0ab5HQ5M XFDgfe8PB5Qvv1XQL5u1Oe4/EG8tDliIYYKJAuEaMy4+40uWnWC+Lt5HB49wfDLmMP6U ahLtu75yPRiXKF1/6Xl3QfnOui8CuaaNtiDp6oDKwq3n9n5aGPZELc4d7siEhO4iCqK1 uvvPsRWVNAAhKQz6hTAgm3VnKSC6gkf7o8uqTyBY6G2N3PVN3GA32U0A0a3tKtE/Cm60 ZqVLSemcWzGtzZZUJkAVb6/hAt/6zZj3XnDz07JKKdvsxKS2DDOiz4Zm/hyZXOHkFr5q qrdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LiwAykOMjrQbIV7wRUuELApm7pPFAK8h4lavMKkgQyY=; fh=Y2IfAqdjkYQAx7XZcGq/8JceY1atOOwfX771vvMvH7o=; b=rBjsKuz2lfnfynqBmhCIRT6zB3Y3FK/kraE1uZPLIwlQ977guKN+lss+IlDvWkoL3k OGW1VEmO+gXVRZJfJb47QJR//FpFCsEF7Nqb9GkdaO1nNg9TSz5bI8Px7/b91uYh2jCv 2049JxosmcQA8fHxnhcIBsPpT2t/KrMZXO+ly1+Rh4uFffREgLb3CryIQP8H7WQyye18 gRoHPMm804yG2jY1u0tZX9+Pl+1NNxxPRjDTCqvttajwncGGTiWJSiQmepg9eVO13ia0 1lKTJvhWA0faPlBgibihn5JR7uipULGMDQ2nfRAyy4uf/F+VozfwSzhLL/BcGLW1lyqm vhLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YZ+YiPYu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j14-20020a170903024e00b001b9d800b487si21417891plh.87.2023.09.28.11.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 11:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YZ+YiPYu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 95EC481C998B; Thu, 28 Sep 2023 07:36:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbjI1Of7 (ORCPT + 55 others); Thu, 28 Sep 2023 10:35:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjI1Of6 (ORCPT ); Thu, 28 Sep 2023 10:35:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FE18F9 for ; Thu, 28 Sep 2023 07:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695911757; x=1727447757; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KMTAP9t0Dkd4JWizrMpfBXG3LIrYtLKlRp1BHghxuWU=; b=YZ+YiPYuzwAwgJt9iU62SKDI7vMm6ievlT5H7UkIZu1cV1kX/uf8bsTV ggrgj/h5ETqQR1z4GjrXVVpIdGN2eNaw8jreWO8rnVLmt095BwrTn3B63 cngBLnLSCrLE0g+D8Wr8w/ENShbyg91Lu24tlY2HCkOxpLsj+igQTuT/+ wB1es+6ryCOVIA3jrTYBrQHrEeZtu7PLznue2uoG6sHnzjQX+Us2h0qeS NGRAHnpAKkGKDyKTGgf5ZC6J3hbZp7b8uBq8JwCChv/cowlmpHCA5GMUt /EsLD1jvQR62M8cV0/Sq8syy/PDuP2R1YIBTsnxlZ8WHXELGAkHYY+v5H w==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="688404" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="688404" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 07:35:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="996590389" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="996590389" Received: from smoriles-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.249.92.89]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 07:35:55 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 02/18] wifi: mac80211: drop robust action frames before assoc Date: Thu, 28 Sep 2023 17:35:23 +0300 Message-Id: <20230928172905.f26784ad4601.Ie9f4906e2f6c698989bce6681956ed2f9454f27c@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230928143539.1037500-1-gregory.greenman@intel.com> References: <20230928143539.1037500-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 07:36:01 -0700 (PDT) From: Johannes Berg To be able to more easily understand the code, drop robust action frames before being associated, even if there's no MFP in the end, as they are Class 3 Frames and shouldn't be transmitted in the first place. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- net/mac80211/rx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index fb2d4a7436be..aec851c722f1 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2473,6 +2473,15 @@ static int ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx) return RX_DROP_U_UNPROT_UNICAST_PUB_ACTION; } + /* + * Drop robust action frames before assoc regardless of MFP state, + * after assoc we also have decided on MFP or not. + */ + if (ieee80211_is_action(fc) && + ieee80211_is_robust_mgmt_frame(rx->skb) && + (!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_ASSOC))) + return -EACCES; + return 0; } -- 2.38.1