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);