Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp849365ybi; Fri, 12 Jul 2019 05:40:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyh4SegbJzk8ZAaim+UIb4Z+wWxnXjIMjjn7okUvj/tp7/+qrZ7C0rae8qybDmVeHmfERtc X-Received: by 2002:a17:902:e281:: with SMTP id cf1mr10862989plb.271.1562935235182; Fri, 12 Jul 2019 05:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935235; cv=none; d=google.com; s=arc-20160816; b=gzPTp5/vfQZlglv64n9rxoGR1eKTtgRvsjvNSU38ggNaYbEUizzpCy6frsYwGycq5M bfPKjH1dI5yPjVgne/rEAdvFlpMhcdVFMIzvkQ/agicSCa2oJ2CDXZkZOhdvNW2VsmdT uA/xhs1MUvxszVuI52d2gqoK50wZ5kwf/hGcvV0iGktZV1lSvstQeuTYnScPP6slZnfI lmbqgui8QIIsFjcCTGxs2LqXbnb7mfHy9b7+EEXxOX0Mz+oIJ1Yesrqjit18PGfHBjw8 WZx8OkP7zx7dsyXWzSGMc+VsOdWE6WrYCx/5Rvd0IbsdL7xV5R51VdaoK9V4+fzI6x8z L8Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t7edWNjt4jhKwU36vSfIAteKoz2joCOl5l8sISonynk=; b=PcGaU308MeZL6sODkdidocDM/N6yGijYPbdhYGPjctoOgTS6mQDtk9I2wMyugGgHAX U9OJ0YEjBybkqXJe9eQ+yXb3nybj/7eM8PqBc5opkkMesFBArrhB/05ar0cXTkbNTE77 kXwFjYkaRniYp+g983rHoDBC5Q+jYCUVg31M/SipFb58iZWUlbsDVDgwoEcXRgb0ERbf cGZJERoy5hE4S65EUgkQjIRY2F6sRohmeZZoW92W3tBiCfCEsyuLpdcIJdvy/J2giwO6 0XMse+UOspYUCSObEJA2v9B7rcox5ewYHyV4dlV3vacOirtSE3eAXMj+bm+ZbUY24Ecu k2VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a2MD2DK1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x25si8167685pfn.13.2019.07.12.05.40.19; Fri, 12 Jul 2019 05:40:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a2MD2DK1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727544AbfGLMjQ (ORCPT + 99 others); Fri, 12 Jul 2019 08:39:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:40506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728654AbfGLM1k (ORCPT ); Fri, 12 Jul 2019 08:27:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0B2452084B; Fri, 12 Jul 2019 12:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934459; bh=q8PERZs6v5ab/KUl9cYj5n7IxDxsOhsvzGU0Y4jTa6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a2MD2DK15LFiOZwZUFDowDGgA6If76S5+/wlXFK6+8j22HWUaCkEF8BxjIudTNw4X 4470da92/Wj/SG/5WGWti2kOjJ6/YY97QERZKXA/8zMEQHqBFlUijwxH/n4O2I7IYf EVCe5roZuZ8Q6BKbiUeF9g7CjUgIFrHO7veIv7x4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Naftali Goldstein , Luca Coelho , Johannes Berg , Sasha Levin Subject: [PATCH 5.1 061/138] mac80211: do not start any work during reconfigure flow Date: Fri, 12 Jul 2019 14:18:45 +0200 Message-Id: <20190712121631.018684037@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 4118704cb0e7..6708c1640207 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 447a55ae9df1..3400e2da7297 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