From patchwork Mon Oct 21 12:18:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Ha=C5=82asa?= X-Patchwork-Id: 11202117 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0AEB913BD for ; Mon, 21 Oct 2019 12:19:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC74520873 for ; Mon, 21 Oct 2019 12:19:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=piap.pl header.i=@piap.pl header.b="CLbMeDVx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728134AbfJUMS5 (ORCPT ); Mon, 21 Oct 2019 08:18:57 -0400 Received: from ni.piap.pl ([195.187.100.5]:48156 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727256AbfJUMS5 (ORCPT ); Mon, 21 Oct 2019 08:18:57 -0400 X-Greylist: delayed 440 seconds by postgrey-1.27 at vger.kernel.org; Mon, 21 Oct 2019 08:18:55 EDT Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ni.piap.pl (Postfix) with ESMTPSA id A1B08443491; Mon, 21 Oct 2019 14:18:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 ni.piap.pl A1B08443491 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=piap.pl; s=mail; t=1571660334; bh=Tp8OSf1h/wDKpwi0+HzYPecCfDy55FK9qmwYC4Eai90=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CLbMeDVxHJ9JNtZuGbwZP5WljuUhEqWhdQiChl7+y7D2bbVOAbXSXERRWrruUaAnQ joD5Cz0rULQLcizQTb3L6boWn+924hxz9bhnhKdU9wPCgcP+y+QVf/5dMGPUm2jWxi HdZzdmfKXtgE0xHWFOaAwH/nSKLtw9vhkz3X9M/0= From: khalasa@piap.pl (Krzysztof =?utf-8?q?Ha=C5=82asa?=) To: Johannes Berg Cc: "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] 802.11n IBSS: wlan0 stops receiving packets due to aggregation after sender reboot References: Date: Mon, 21 Oct 2019 14:18:53 +0200 In-Reply-To: ("Krzysztof \=\?utf-8\?Q\?Ha\=C5\=82as\?\= \=\?utf-8\?Q\?a\=22's\?\= message of "Mon, 21 Oct 2019 14:11:30 +0200") Message-ID: MIME-Version: 1.0 X-KLMS-Rule-ID: 4 X-KLMS-Message-Action: skipped X-KLMS-AntiSpam-Status: not scanned, whitelist X-KLMS-AntiPhishing: not scanned, whitelist X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, not scanned, whitelist Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix a bug where the mac80211 RX aggregation code sets a new aggregation "session" at the remote station's request, but the head_seq_num (the sequence number the receiver expects to receive) isn't reset. Spotted on a pair of AR9580 in IBSS mode. diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index 4d1c335e06e5..775a51cc51c9 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -354,9 +354,11 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta, */ rcu_read_lock(); tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]); - if (tid_rx && tid_rx->timeout == timeout) + if (tid_rx && tid_rx->timeout == timeout) { + tid_rx->ssn = start_seq_num; + tid_rx->head_seq_num = start_seq_num; status = WLAN_STATUS_SUCCESS; - else + } else status = WLAN_STATUS_REQUEST_DECLINED; rcu_read_unlock(); goto end; From patchwork Mon Dec 9 10:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 11279001 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 603486C1 for ; Mon, 9 Dec 2019 10:28:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3CDC0207FF for ; Mon, 9 Dec 2019 10:28:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727466AbfLIK2x (ORCPT ); Mon, 9 Dec 2019 05:28:53 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:49049 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727143AbfLIK2x (ORCPT ); Mon, 9 Dec 2019 05:28:53 -0500 Received: from evilbit.green-communications.fr ([92.154.77.116]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MXGzQ-1iETnT00pa-00YhTa; Mon, 09 Dec 2019 11:28:49 +0100 From: Nicolas Cavallari To: =?utf-8?q?Krzysztof_Ha=C5=82asa?= , Johannes Berg Cc: linux-wireless@vger.kernel.org, Kalle Valo Subject: [RFC PATCH v1 2/4] brcmfmac: Do not allow deleting station in IBSS mode. Date: Mon, 9 Dec 2019 11:28:07 +0100 Message-Id: <20191209102808.12014-3-nicolas.cavallari@green-communications.fr> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:prXbdW76TtwtqcADBuYpY6/a331iqmlHWd9SZDw51+h9foZvEvo yIAw9xdMo3xDG2lTOT5JoPCZI276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uUtdulopaX17WnP59KHBOsR2M8krQUM7y3 x5m8blQ/DmgGnH4dPDd5TSssVxhJYNP5rPz2cU1m9GArbUdzpJQTyizffuaZir Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In preparation of allowing userspace to explicitly reset station state in IBSS mode, reject attempts to delete stations in IBSS mode with error EOPNOTSUPP. Signed-off-by: Nicolas Cavallari --- I do not know if the driver could possibly support this, so take the safe route and reject it. --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 5598bbd09b62..5436ffd74ecb 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -4848,6 +4848,8 @@ brcmf_cfg80211_del_station(struct wiphy *wiphy, struct net_device *ndev, if (!params->mac) return -EFAULT; + if (!brcmf_is_apmode(ifp->vif)) + return -EOPNOTSUPP; brcmf_dbg(TRACE, "Enter %pM\n", params->mac); From patchwork Mon Dec 9 10:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 11278997 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31E6F930 for ; Mon, 9 Dec 2019 10:28:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FED7207FD for ; Mon, 9 Dec 2019 10:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbfLIK2y (ORCPT ); Mon, 9 Dec 2019 05:28:54 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:38603 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbfLIK2x (ORCPT ); Mon, 9 Dec 2019 05:28:53 -0500 Received: from evilbit.green-communications.fr ([92.154.77.116]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MMoT4-1iLdTB0m6G-00Ii7g; Mon, 09 Dec 2019 11:28:49 +0100 From: Nicolas Cavallari To: =?utf-8?q?Krzysztof_Ha=C5=82asa?= , Johannes Berg Cc: linux-wireless@vger.kernel.org, Kalle Valo Subject: [RFC PATCH v1 3/4] mwifiex: Do not allow deleting station in IBSS mode. Date: Mon, 9 Dec 2019 11:28:08 +0100 Message-Id: <20191209102808.12014-4-nicolas.cavallari@green-communications.fr> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:WtLVDy6lCBGKrcXQRP5BsZitH8ttNG6uNOaehXYGA394tggpcHi U+2R57f4fT1/Sq86ECjvsSXnkXuMIfb9WmV1yKxgDhpour1KX0IBPNbu9cN5zeyFhn7bmiM 1X6g4Rc6lGvJI230pzQhpY57B53KkGNXfrN4MuPGRIWNIsNDezqK7hCCF5rg4X+ZICfKObz 1x4rrR6OSvMHGYHWkIVkA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:30NEgQLZr9Q=:kr5PCpUtHZip8R9LEZQhDv x44JIa9OxOIPYzlipXl4bAytvsRgB/gC18NzxUpeV6ArufuDUMI/DYdpvE37yLuaF5l4HhW5X NoYZYE1vUg9sL/uKTUUsIeulqMnL4hXX3pJyJXd0TfndKTweOrmhhvvfRPlVz0gDzQ7AQUq5B aRtnlptnKCKZ8AjaV+778zxDrvI0FwFaJnx21f/5rbutdK0+N/qfc01JhtMgWx+RTFSwnaQGc ydFORU2PXXLqUz01OUbWV82j1a2BPnWB3nLb9l+BaXe/gmRNW4SqJj76nFOcC5SdfWYvScdaM tnDa33+/OwnQnVVDC093g4DyVISU9LR+SRqSDi65UxdcXMF1/VUfKccd8M/1ODpgxEHxLrIDX 9hZLbAS++CVvmRl7CtHiTLujtFmMLIHNMvanrAF8HzzeEdn1ib3RJruMnOVTJL0V9SV3Lr3Wh E2DgRm8X5BlW7cTfBzffh0BUXNjifamBTZifCAtXQjKJED2vv9QQKNYX+E04WuRx9iGMfKDAf +7FLmAfMyHvY3dRnJfr01zlF1fBOcKhZGP7MEnUwGxbfFXRjm3HO/+cVrboNnuvB1is80ylmT 7c8HQF6ydfMa6fdM6TefFW09KdmNSlYKemeu5Xmf6pi/QdMcJGyqt7HrsbU5OcX9MVc3ccsm5 GL9Y+Q6t/uAnhq/0aTKLUihYa9h+oLHU0xuMzA3BDF1YdNQ9cWZ91+MoNscLbkjz1PV/VmYNv PgMtnE9e9BXl3VTU/W2XHqLA2saPHRDOE0IHi0GqykOk0ZWzCSVsg0gaSwbWYEW7bYSBdoYLH CFJ98X0GXwxcQaPHHFTj1bk/TT3SM9F0ENrxkgU+Ch5pxYrMIJu2wxCIlgM5iCCDC3KDH0D20 w85aOZS5HJfqpQS8+pdG8pjhKUjyjF7YMxZBtADukQetTx//jPXxDSGZLT50/6 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In preparation of allowing userspace to explicitly reset station state in IBSS mode, reject attempts to delete stations in IBSS mode with error ENOTSUPP. Signed-off-by: Nicolas Cavallari --- I do not know if the driver could possibly support this, so take the safe route and reject it. --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index d89684168500..9135fc6d5a70 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -1828,6 +1828,10 @@ mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, struct mwifiex_sta_node *sta_node; u8 deauth_mac[ETH_ALEN]; + if (priv->bss_mode != NL80211_IFTYPE_AP && + priv->bss_mode != NL80211_IFTYPE_P2P_GO) + return -ENOTSUPP; + if (!priv->bss_started && priv->wdev.cac_started) { mwifiex_dbg(priv->adapter, INFO, "%s: abort CAC!\n", __func__); mwifiex_abort_cac(priv); From patchwork Mon Dec 9 10:28:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 11278999 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3AFB930 for ; Mon, 9 Dec 2019 10:28:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA6A6207FD for ; Mon, 9 Dec 2019 10:28:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727482AbfLIK2z (ORCPT ); Mon, 9 Dec 2019 05:28:55 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:33129 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbfLIK2x (ORCPT ); Mon, 9 Dec 2019 05:28:53 -0500 Received: from evilbit.green-communications.fr ([92.154.77.116]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MTREY-1iAbuP1ZSW-00TjfQ; Mon, 09 Dec 2019 11:28:49 +0100 From: Nicolas Cavallari To: =?utf-8?q?Krzysztof_Ha=C5=82asa?= , Johannes Berg Cc: linux-wireless@vger.kernel.org, Kalle Valo Subject: [RFC PATCH v1 4/4] nl80211: Allow deleting stations in ibss mode to reset their state. Date: Mon, 9 Dec 2019 11:28:09 +0100 Message-Id: <20191209102808.12014-5-nicolas.cavallari@green-communications.fr> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:T8maCSyhvPavolayW/MJ+YJXm/7c1Rgd+tqDj6pc/ZbOyoROH2M E/DrYCxw7iglert2qOBBznvHIglky8X1LhlWULY0fMI9h3xXzzJOjczb9WQZgk231nvY9CV lq5olqMZswydtj541VoflDlffHw7fcwwTGolj/huETHo+LLSZTneFsrrF5U53HSw9UhqiEo 2vFSG/nFdJ0fi2T3Fr+IA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:PYck0YGAtRw=:JoM4AP/D0aRlMIqrMqSUTh ds2Q726hzVtnbF8CcBaDg0JmuhcBUF1E268bJCsiT6DSzmCXGAU8CNdlJskE1JCUFcQlq0/kg /1t9NqfHTXOLJsG9yg/jnQYz5qTclM1f8KznT+s/BAo7Nve2q/qYwbyupmYJyymYfN1zFJMlq kAxfd163AMhtK9jW0OJ9G7l8qCkZWAbQiJ/J42Qi9/2T0RwemKjkQtzoxPgKeASlDM+/11OJd YBKWzm1rd5iH6p9f/NCTfZVsxeiE2SSo3xacVrC/D4LH0jTJbTEi2apA3LnqMGENjC79fj2q4 SQhgw6+TYTeXC7Pe08L87oQ/5UxHSTgiNsoW7LYwQHpZmpq6HEWTDM8WD3pacLjPeta5GPuRb sp9D+JcNdlXDWLmYLHMbhmvyoP534TMa3xlR8RXQyhnC0YU0BJF7nRcBKr1qGWOre5pAKBX6Z /p6ThpHppUsVinAu4gS0IAywlDnYgNfLY8g4Ao3oSMhwLEtqZ3ZqbpSGnfdyqVhJyjmfLHlAf prCvrvD8C5AAjiJ8k14Bw5AaH8VLZnn1j3r2IDWS0YhVzjzsoc7NKQDljNLSpH32+r3mIn+pJ mE3yjzAE+Sr9wdmFrbXG+Gk7bxrXRBISMcQ2sSlbfTXm7Q5SdG1dg3f960XuK5M9JZRQDyli2 +ovMZ4iFmG6D3qHcaoRQ5S/7CYd3TlL4XxEJyPYXPwK79VJuNcAyOuP0PRxgz/bofJf8RUf9n /mooS3WBnqujfHLwP0EoMjuwtCpPQ8nDHiMvwzUB5Oo9jZiwyoArRf4wZKsxNDw4NvrTGbf6H Bhr4zS3OR7XHgOOCdQRaGXqza1enmschdDdLUaFTLTFP1DaBx9X7rho3Kcl8yagiwSHzIqkGQ MTU9669akelYTY66Gvl0RSRpi7dI8NFzNYomye0mqDN8SKdVDWr6gqR29QGWer Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Sometimes, userspace is able to detect that a peer silently lost its state (like, if the peer reboots). wpa_supplicant does this for IBSS-RSN and currently only resets the key of the peer so that it can attempt another handshake. However, the kernel also hold state about the station, such as BA sessions, probe response parameters and the like. They also need to be resetted correctly. This patch allow userspace to use NL80211_CMD_DEL_STATION in IBSS mode, which should send a deauth and reset the state of the station, just like in mesh point mode. This has successfully been tested with mac80211/ath9k. Drivers that do not support it should just return an error, so that userspace can fall back to the old methods. Signed-off-by: Nicolas Cavallari --- net/wireless/nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index da5262b2298b..82046c990a2a 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -6073,7 +6073,8 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT && - dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) + dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO && + dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) return -EINVAL; if (!rdev->ops->del_station)