Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3862911pxv; Mon, 28 Jun 2021 15:03:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrF+r5hgj6I/b+MHbrjXgmyiNUz2fAZySWO/xEj33z9k5UGMob6HhCQWgC1XV7R1J/Rjzd X-Received: by 2002:a05:6402:759:: with SMTP id p25mr36213883edy.146.1624917785360; Mon, 28 Jun 2021 15:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624917785; cv=none; d=google.com; s=arc-20160816; b=zdKkTeszbyaNrOWDNtJRkbdmBWt3uyChIsWEGxDX+ms9sexaQIQsLE3KAAzRj1RTBU Q1T329ZUMT53/L2ivMcbg3VdOcQsX8yCaUlC2dk11m/exjVPbkYp+oG/LOZ1DlwSZyff LuzAmoVMSyQ74P8WFsv1uyXR0FSBUTq+PnHFfR/8Uy+lgK4Q6CcBjsMONc4/Mw+k4hml rJQKuAAXmh9ZDET5IuZOOi4V1sj92RocnJyh4VtgYA2BQ0lcpglyX61g0RlrcaqlW9Rk TQv/XOsR6sHzK2YYkV/lmQFy4Qo7/RvYJI35WKhuuWAGqTBIk4+XHT+NtCt1/AxYNB7Y jhFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YyjVZ8X9mzv3D3G/AnXX1w5pB89Lt+PtdktHSK6PpL8=; b=l3IXjaWpfY8Shc0EkQI4ZjGm1LlHVGcjuOt7AqubPTR7IdIzIcQn69+xEIifzsEt+2 npaVlIJQCxZShgGKHeWNKYhqezzbhd6VYa+SmDoSqRGkxLADbcHGewYD0AHbLGHRH/mv EvxJ4k9i3GOX2m4pj/ccm9Nmrjs6fYc7j/QDstKqjkRPESz9CtkBU1yKlWbIQc2bSc2h vXtWCc746piBuYjexz5M7ekj67EVwQDYwb5QKdDoizlKNXZg7e2PGEIRJ7udh8lMvZBN ISoBtNSvcVA0LxiPt95bR17LYBF6IzbLGFyho54jrFeHzUOw2FGZpT1bh7R2RPt96Fb0 HboA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="S1H2/zVt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hw7si4247600ejc.145.2021.06.28.15.02.38; Mon, 28 Jun 2021 15:03:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="S1H2/zVt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238022AbhF1PYR (ORCPT + 99 others); Mon, 28 Jun 2021 11:24:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:36548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232273AbhF1PAZ (ORCPT ); Mon, 28 Jun 2021 11:00:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D76461D6E; Mon, 28 Jun 2021 14:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891254; bh=RpX+WGxLTHL19BXdL9ZW8S463Uw+Gr86xTRwIYqWZKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S1H2/zVt611fSdR8jGM9TW+Oaz5T+8iaSjtRwCBqi9tFZ73XwC5n13v9H6ow/wfYh BvmhXTkeQ2ePdA54aMu80SUaNiPkBKVUfjW3uHv2WxZf0OE56uNA18mbbuhnauomLv T5GONRQzC/nkxTKo5d669P+aK/VtMq8o3bcA3SCL9PsiOV2LBKGFUYUVzFsxFZX6aI mZVfklB6jSbH3sE/Offh9nFz4b1DitRfKtVjqs4DfJ6Wg/8t2fOhkt1I/hv6NYqW4u 1UOokFcRdO7OGj79pjM4EDyohHllQaibzUbszNDP4YdQFtyH6OMlWldfqeHQq+nkkX um+MXHXg1n7jw== 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 4.9 56/71] mac80211: remove warning in ieee80211_get_sband() Date: Mon, 28 Jun 2021 10:39:48 -0400 Message-Id: <20210628144003.34260-57-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144003.34260-1-sashal@kernel.org> References: <20210628144003.34260-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.274-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.9.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.9.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:39+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 21b35255ecc2..f5532a3ce72e 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1391,7 +1391,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