Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2970657rdb; Mon, 4 Dec 2023 12:37:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrqb1I7OSaJInREAZwQlTTUxHeonZhTBquoSrvVneTLQBwDnhIJSNx5GJI/VYKeFd/S4dr X-Received: by 2002:a05:6808:2384:b0:3b8:b447:2626 with SMTP id bp4-20020a056808238400b003b8b4472626mr4694179oib.81.1701722268500; Mon, 04 Dec 2023 12:37:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701722268; cv=none; d=google.com; s=arc-20160816; b=BeFDn3/px5Cm1YnPfVCdf4GXwC7Jqq6RnTn61GUv1mDSO26WGOybb8JWXLpzCRguRk BKxM1K0c+6/S5qUAvTcGP59df2yM4qDA3chQYrj8CurMeE+8200oxowj8qxSKAd8Sd3K EU4r8AyfwVmPk8hpJGgmUvx7A4H2sJqzegBB4Nez+cYK4RfF/clpMvQP79kb+xG/9eJL YJU67IeK/9skXM28fY+4OaTiFG7uyNIPy7PE7c4zWWWpCFYLgfnksEJFPjoXhSCUQeUK /qoI+sfRQtytMreXWs3kH1cRNuhKJ2r2dQW5PQdeHKUZM9okJdO1PwoWYuDV0h4sS8h8 zzNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=1XpoOCaRgE2gDJDWhyxvE21yoTQMI+4KhyqO5zq0yqA=; fh=cqFGi7+oHk5ltqbcESkthCaO6BxQXHr8k6FicmOtjzY=; b=BIpflu90mTrdinD7Qb/758IQcjp4DdfW6KWi/SDBvu0GI97V8E2OskIqqXER3jPpve spP021dTbKzQ10USAUkL22QQtBUchJyOGn/f2X7YeyltSw5EhZ4ZP0JdEHaoPNyzVl4Y bk8Mdg8lDmt0naDzwo08o9OuosSu89t52Ow2m4Dcr1mc2F9BTBZ2xKXD7WKPQQNdPi8e GgMqfhkR0ymgNwX8VwuHZPnWcTJeqkSTszHQ3H53PYmDPvhwamsKWNnDVzRK2xce1qLx TyamYdgvwgcahtvCfO5q0q8sxuGFjqmgFgccgzjJR79KqveJFGHRm5s+zdvxPs4qfTkL yXkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DseyW8QA; spf=pass (google.com: domain of linux-wireless+bounces-402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ca5-20020a05622a1f0500b004198662d6dcsi11018743qtb.592.2023.12.04.12.37.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 12:37:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DseyW8QA; spf=pass (google.com: domain of linux-wireless+bounces-402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 309C11C20BAE for ; Mon, 4 Dec 2023 20:37:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39FF6321A8; Mon, 4 Dec 2023 20:37:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DseyW8QA" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FC7A364B1; Mon, 4 Dec 2023 20:37:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36590C433C7; Mon, 4 Dec 2023 20:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701722258; bh=jQ+D2iihSTK+aKrxjtXFfBlStzbtYXPCbVhBZbnb9bo=; h=From:To:Cc:Subject:Date:From; b=DseyW8QAj8aBxawwdrp9SofXXecA8Ygo5O4qtDnMWwuRwSEe9rB/ijhcuV7WQjvln xOHvc/2NSucx+ZLy/+tEdSi6CZLZCR1Cck++tsFWO+B1drwszqOYlhUEVAwm172HeI 9hTTGHzBD0fBqnFqhni0ZPzwtoNGdOY0gpT2Acy+rKehTuYrqD9YoYp1L/vxcTl1R6 +L1wivZ2fmpPuHL6xV2JPSoq3ZlcTu9f7rq96rBbtoP/ghJXZc3HFhL46kYWrJC8WB CWMwNwukU9GQjDhDpZFRT7WROOtHOq9Pjcr0ptGjCnXVnQaiFqAUPMmFtz9kNVhMMh M5olsi8q9zz4A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Johannes Berg , syzbot+7e59a5bfc7a897247e18@syzkaller.appspotmail.com, Sasha Levin , johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14] wifi: cfg80211: lock wiphy mutex for rfkill poll Date: Mon, 4 Dec 2023 15:37:34 -0500 Message-ID: <20231204203735.2095033-1-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 4.14.331 Content-Transfer-Encoding: 8bit From: Johannes Berg [ Upstream commit 8e2f6f2366219b3304b227bdd2f04b64c92e3e12 ] We want to guarantee the mutex is held for pretty much all operations, so ensure that here as well. Reported-by: syzbot+7e59a5bfc7a897247e18@syzkaller.appspotmail.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireless/core.c b/net/wireless/core.c index 0e08629b15d1d..abe7912a23760 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -202,7 +202,9 @@ static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) { struct cfg80211_registered_device *rdev = data; + wiphy_lock(&rdev->wiphy); rdev_rfkill_poll(rdev); + wiphy_unlock(&rdev->wiphy); } void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev, -- 2.42.0