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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 34B70C742BA for ; Fri, 12 Jul 2019 12:22:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 050E5208E4 for ; Fri, 12 Jul 2019 12:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934147; bh=CtAmJilVIee1UWeSiQyh9QsVVeQ5FEfy3Y58JV9tmSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZGOLY1UjH8jgnPbX7g5vJEbx2OLv/TVPAlS+qnN4n7BLWR0m83qMYTQmRtGtsT/66 FFWPseeJmoSSd3VD4PkyPUV0bYOmiw51zJp4NnF9GTm53zGCBPdKMOtMP3mgk5RYOT abEjHX2yMMFXr1ncxzTXLuvlfdbcWbYfeELWsoRQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727018AbfGLMVR (ORCPT ); Fri, 12 Jul 2019 08:21:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:55324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfGLMVR (ORCPT ); Fri, 12 Jul 2019 08:21:17 -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 3587D20863; Fri, 12 Jul 2019 12:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934076; bh=CtAmJilVIee1UWeSiQyh9QsVVeQ5FEfy3Y58JV9tmSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O3V1lUYy/1OF9EZlT2ckFwNbRhQN7meGk45nTAj9CCwupRkVZRLje0QHhqOVnCEoG xJqM3ppbWdVRPKp02phVDcdmlgtgU3W4+/a0Eff62rlPEI2FPx7GBbeqjW0iCmkh5F 36G3S8DC+JxW9FBWpVmqM/kNKlvTKWvzHAEo7p9w= 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 4.19 37/91] mac80211: do not start any work during reconfigure flow Date: Fri, 12 Jul 2019 14:18:40 +0200 Message-Id: <20190712121623.398020925@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121621.422224300@linuxfoundation.org> References: <20190712121621.422224300@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 24f5ced630f5..cfd30671ccdf 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1998,6 +1998,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 2558a34c9df1..c59638574cf8 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -2224,6 +2224,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