From patchwork Mon Apr 22 21:34:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 10911751 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7876114DB for ; Tue, 23 Apr 2019 01:10:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 693D8287C1 for ; Tue, 23 Apr 2019 01:10:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AEB7287BB; Tue, 23 Apr 2019 01:10:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D4C5287BB for ; Tue, 23 Apr 2019 01:10:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729068AbfDWBKv (ORCPT ); Mon, 22 Apr 2019 21:10:51 -0400 Received: from 15.mo1.mail-out.ovh.net ([188.165.38.232]:34379 "EHLO 15.mo1.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728615AbfDWBKv (ORCPT ); Mon, 22 Apr 2019 21:10:51 -0400 X-Greylist: delayed 10799 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Apr 2019 21:10:50 EDT Received: from player774.ha.ovh.net (unknown [10.108.42.239]) by mo1.mail-out.ovh.net (Postfix) with ESMTP id C306F16A02C for ; Mon, 22 Apr 2019 23:34:22 +0200 (CEST) Received: from awhome.eu (p57B7E5B2.dip0.t-ipconnect.de [87.183.229.178]) (Authenticated sender: postmaster@awhome.eu) by player774.ha.ovh.net (Postfix) with ESMTPSA id 27BF84FCF198; Mon, 22 Apr 2019 21:34:21 +0000 (UTC) From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1555968858; bh=s8t48NXZa6gc1Q8vLHeUnxBFD1vZHBuqRu7UTw69KO0=; h=From:To:Cc:Subject:Date; b=apW/hpbbWOlk3Gb/P/8FosA+W+v6V71zd6ChNrNNCpdlt/kj3TJobRVUIEZ7GejyM yODK2bE5KIy9GcYFWhVrZW/e2V1yZ75Mu5HUUbjKFsTboVjivbqdh6uBi+IeKLi4by moPUcJKiq2c5jIVYOSCsHV/3lviYNydQmwSM5loU= To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Alexander Wetzel Subject: [PATCH 1/2] mac80211: Fix Extended Key ID auto activation Date: Mon, 22 Apr 2019 23:34:11 +0200 Message-Id: <20190422213412.16533-1-alexander@wetzel-home.de> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Ovh-Tracer-Id: 3701395944886312135 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrgeeigdduheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only enable Extended Key ID support for drivers which are not supporting crypto offload and also do not support A-MPDU. While any driver using SW crypto from mac80211 is generally able to also support Extended Key ID these drivers are likely to mix keyIDs in AMPDUs when rekeying. According to IEEE 802.11-2016 "9.7.3 A-MPDU contents" this is not allowed. Signed-off-by: Alexander Wetzel --- net/mac80211/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 5d6b93050c0b..af73f42960fa 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1051,7 +1051,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) } } - if (!local->ops->set_key || + /* Enable Extended Key IDs when driver is either allowing it or only + * supporting SW crypto without A-MPDU + */ + if (!(local->ops->set_key || + ieee80211_hw_check(hw, AMPDU_AGGREGATION)) || ieee80211_hw_check(&local->hw, EXT_KEY_ID_NATIVE)) wiphy_ext_feature_set(local->hw.wiphy, NL80211_EXT_FEATURE_EXT_KEY_ID); From patchwork Mon Apr 22 21:34:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 10911679 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6186922 for ; Mon, 22 Apr 2019 21:52:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6CDC287CC for ; Mon, 22 Apr 2019 21:52:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAD44287F4; Mon, 22 Apr 2019 21:52:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FEB2287CC for ; Mon, 22 Apr 2019 21:52:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727607AbfDVVwb (ORCPT ); Mon, 22 Apr 2019 17:52:31 -0400 Received: from 10.mo179.mail-out.ovh.net ([46.105.79.46]:54096 "EHLO 10.mo179.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbfDVVwb (ORCPT ); Mon, 22 Apr 2019 17:52:31 -0400 X-Greylist: delayed 600 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Apr 2019 17:52:30 EDT Received: from player718.ha.ovh.net (unknown [10.108.42.176]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 2DDBB1253AC for ; Mon, 22 Apr 2019 23:34:21 +0200 (CEST) Received: from awhome.eu (p57B7E5B2.dip0.t-ipconnect.de [87.183.229.178]) (Authenticated sender: postmaster@awhome.eu) by player718.ha.ovh.net (Postfix) with ESMTPSA id 81ACF4EDEE37; Mon, 22 Apr 2019 21:34:19 +0000 (UTC) From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1555968858; bh=WgM0UDRnPlmG8UkabbpibpT2If8wShVK3tOLFJxTzFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ylXXAfwEYJGshXPELYHhU0lJhLS+/5v82KoAfgEbDLgcMS/O/Bg3jzRNGBmB6Qf3U scjUluYaApxPAB4l2CpN/ZgUo7B/CgGfSLUI8MEhoL0SyG772GCSyDMZaUgwiMb8qY QJV31A0/YTNYVGqXspYg52QVJinavoTsm2aeNK8Y= To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Alexander Wetzel Subject: [PATCH 2/2] mac80211_hwsim: Update feature flags Date: Mon, 22 Apr 2019 23:34:12 +0200 Message-Id: <20190422213412.16533-2-alexander@wetzel-home.de> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190422213412.16533-1-alexander@wetzel-home.de> References: <20190422213412.16533-1-alexander@wetzel-home.de> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3701114470241737927 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrgeeigdduheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hwsim is not using HW crypto offload and can correctly rekey PTK keys. Set NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 to not trigger workarounds. Also allow Extended Key ID to be used with hwsim, regardless that the driver A-MPDU aggregation is violating IEEE 802.11 and can aggregate MPDUs using different key IDs into one A-MPDU. Hwsim can only communicate with other hwsim cards and itself is able to handle the non-standard A-MPDUs on Rx. Signed-off-by: Alexander Wetzel --- drivers/net/wireless/mac80211_hwsim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 44cffd1f6dbf..7abe52e3357f 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2810,6 +2810,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, ieee80211_hw_set(hw, SIGNAL_DBM); ieee80211_hw_set(hw, SUPPORTS_PS); ieee80211_hw_set(hw, TDLS_WIDER_BW); + ieee80211_hw_set(hw, EXT_KEY_ID_NATIVE); if (rctbl) ieee80211_hw_set(hw, SUPPORTS_RC_TABLE); ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID); @@ -2824,6 +2825,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, NL80211_FEATURE_DYNAMIC_SMPS | NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR; wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_VHT_IBSS); + wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0); hw->wiphy->interface_modes = param->iftypes;