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 756E9C76186 for ; Thu, 18 Jul 2019 03:13:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F5B121849 for ; Thu, 18 Jul 2019 03:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419623; bh=cbDGiyi6hbLJr4yOWaPXF50PHuK/CLNi9UwUOTgiQo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zCwfeEZLp5U7JiSOFPCzRx1x4sQczljTxF0SlIbxXNyMKUFxPTZnklEbSb4DR3f2C EnsQijsnMeYWZjAs5U3lT+Fz1C1BiJ0yRVf+QrwIAJC5RjDkYfloihy8fHTu5QcFuW ccMWZBhkTgFmBES170cULPZ4Q0bfpfdr0ZWvlCjU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391564AbfGRDND (ORCPT ); Wed, 17 Jul 2019 23:13:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391559AbfGRDNC (ORCPT ); Wed, 17 Jul 2019 23:13:02 -0400 Received: from localhost (115.42.148.210.bf.2iij.net [210.148.42.115]) (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 8282B2053B; Thu, 18 Jul 2019 03:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419581; bh=cbDGiyi6hbLJr4yOWaPXF50PHuK/CLNi9UwUOTgiQo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lXUCmP8+rplU/jSoqmjRLo6fYm1xG9sgsIccTW/X0KHbKXVQ5wHrrHmUBc6FAumZt B3K/SEZvnXvpqtTmAEakG8WZcRCzOWRqshAZnQxz/rd1YkaED8mLuoQ+PF+5FLcCx8 i7WBoPN8KlE1VCbx2+qlA1JwahH2YBB8IgdF7k4E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhi Chen , Yibo Zhao , Johannes Berg , Sasha Levin Subject: [PATCH 4.9 17/54] mac80211: only warn once on chanctx_conf being NULL Date: Thu, 18 Jul 2019 12:01:47 +0900 Message-Id: <20190718030050.642179649@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030048.392549994@linuxfoundation.org> References: <20190718030048.392549994@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 563572340173865a9a356e6bb02579e6998a876d ] In multiple SSID cases, it takes time to prepare every AP interface to be ready in initializing phase. If a sta already knows everything it needs to join one of the APs and sends authentication to the AP which is not fully prepared at this point of time, AP's channel context could be NULL. As a result, warning message occurs. Even worse, if the AP is under attack via tools such as MDK3 and massive authentication requests are received in a very short time, console will be hung due to kernel warning messages. WARN_ON_ONCE() could be a better way for indicating warning messages without duplicate messages to flood the console. Johannes: We still need to address the underlying problem, but we don't really have a good handle on it yet. Suppress the worst side-effects for now. Signed-off-by: Zhi Chen Signed-off-by: Yibo Zhao [johannes: add note, change subject] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/ieee80211_i.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 8a690ebd7374..6708de10a3e5 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1403,7 +1403,7 @@ ieee80211_get_sband(struct ieee80211_sub_if_data *sdata) rcu_read_lock(); chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); - if (WARN_ON(!chanctx_conf)) { + if (WARN_ON_ONCE(!chanctx_conf)) { rcu_read_unlock(); return NULL; } -- 2.20.1