From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20F5DC48BD3 for ; Thu, 27 Jun 2019 00:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0FEC2082F for ; Thu, 27 Jun 2019 00:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561596713; bh=B+vw4Mx6McYj4L0NkRQ3Uhzpey5yO2H2Hz44qQslpnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2NebBhw+mpahM4BKqezkCtd2IyqVvvJZHU0k/fYqslOPARmrrp9zgD122ne/nFUXc mCAKqRkrLO3lrwcLLzdnaNAZ4/aFmGXQDPNXsrz53KkX9+3qI4luddSWH0cKnwLLZL twpZce4ljN2qOxXkc/aTuL276kluZexbytIYZLtk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727928AbfF0AeG (ORCPT ); Wed, 26 Jun 2019 20:34:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:38144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbfF0AeF (ORCPT ); Wed, 26 Jun 2019 20:34:05 -0400 Received: from sasha-vm.mshome.net (unknown [107.242.116.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 166E320659; Thu, 27 Jun 2019 00:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561595644; bh=B+vw4Mx6McYj4L0NkRQ3Uhzpey5yO2H2Hz44qQslpnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eXKRHmdYYj5snYb+w1584qtsVcy5uc6SFxStT2r/CI+t1ApHKlsvrqitl5g8dWr6Z kI3IQbXa9+9owxOv/vixlqamTkugRhSbXXqAOGOH1UhoA4A8M2feAQUX5MsYaHrKJ0 Yf6yyazb4K6lvaqzPfKgmcPa/B5DQvJ3GrTFxB/Y= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Naftali Goldstein , Luca Coelho , Johannes Berg , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.1 65/95] mac80211: do not start any work during reconfigure flow Date: Wed, 26 Jun 2019 20:29:50 -0400 Message-Id: <20190627003021.19867-65-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190627003021.19867-1-sashal@kernel.org> References: <20190627003021.19867-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Naftali Goldstein [ Upstream commit f8891461a277ec0afc493fd30cd975a38048a038 ] It is not a good idea to try to perform any work (e.g. send an auth frame) during reconfigure flow. Prevent this from happening, and at the end of the reconfigure flow requeue all the works. Signed-off-by: Naftali Goldstein Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/ieee80211_i.h | 7 +++++++ net/mac80211/util.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 2878ea8a01fd..53fbad3b99b8 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -2034,6 +2034,13 @@ void __ieee80211_flush_queues(struct ieee80211_local *local, static inline bool ieee80211_can_run_worker(struct ieee80211_local *local) { + /* + * It's unsafe to try to do any work during reconfigure flow. + * When the flow ends the work will be requeued. + */ + if (local->in_reconfig) + return false; + /* * If quiescing is set, we are racing with __ieee80211_suspend. * __ieee80211_suspend flushes the workers after setting quiescing, diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 4c1655972565..70f5816412bb 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -2442,6 +2442,10 @@ int ieee80211_reconfig(struct ieee80211_local *local) mutex_lock(&local->mtx); ieee80211_start_next_roc(local); mutex_unlock(&local->mtx); + + /* Requeue all works */ + list_for_each_entry(sdata, &local->interfaces, list) + ieee80211_queue_work(&local->hw, &sdata->work); } ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, -- 2.20.1