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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 0453BC2B9F4 for ; Mon, 28 Jun 2021 14:20:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB43361C8A for ; Mon, 28 Jun 2021 14:20:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233539AbhF1OXA (ORCPT ); Mon, 28 Jun 2021 10:23:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:54500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232790AbhF1OVS (ORCPT ); Mon, 28 Jun 2021 10:21:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F09E61C79; Mon, 28 Jun 2021 14:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624889932; bh=8MTBfsk6pvIQk1lT+ke+rQcj+rsp+htuVw6l1OINRpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jbVlXrwBfQuTmhiZWW72oKzVGVxe7TPQ8RYeCLEPZjlCJKzHBgTxYorrALdlteINQ 82Zyxgi+RCAWt115qBTOISeNQJfQsSe3j2RGJVVDFCUyPk27w9aiF2XQUI4ldjLM3X xXD6WuTXLwSIL5YoTdEQkEg6eU2P6GHlAZwtvzYuxSjbmgnTr0Zd6AUoq2U2rc0+Ir px919A8RSlF57sOwKMoG7s8mDOVfLFYw+qIVCemYheZ+VavVsC/30Xcb3x8NYYO6FD QIZeeGtQUY4EuhYZFUV7BYV2Je9UNSLCavok1/kBKVts3ZTC4uIHPQBvAJsfJPMfsM wsiduLxfHawPQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Johannes Berg , syzbot+7716dbc401d9a437890d@syzkaller.appspotmail.com, Sasha Levin Subject: [PATCH 5.12 026/110] mac80211: remove warning in ieee80211_get_sband() Date: Mon, 28 Jun 2021 10:17:04 -0400 Message-Id: <20210628141828.31757-27-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628141828.31757-1-sashal@kernel.org> References: <20210628141828.31757-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.14-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.12.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.12.14-rc1 X-KernelTest-Deadline: 2021-06-30T14:18+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg [ Upstream commit 0ee4d55534f82a0624701d0bb9fc2304d4529086 ] Syzbot reports that it's possible to hit this from userspace, by trying to add a station before any other connection setup has been done. Instead of trying to catch this in some other way simply remove the warning, that will appropriately reject the call from userspace. Reported-by: syzbot+7716dbc401d9a437890d@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20210517164715.f537da276d17.Id05f40ec8761d6a8cc2df87f1aa09c651988a586@changeid 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 02e818d740f6..5ec437e8e713 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1442,7 +1442,7 @@ ieee80211_get_sband(struct ieee80211_sub_if_data *sdata) rcu_read_lock(); chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); - if (WARN_ON_ONCE(!chanctx_conf)) { + if (!chanctx_conf) { rcu_read_unlock(); return NULL; } -- 2.30.2