From patchwork Tue Jun 6 12:34:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 690141 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD637C7EE29 for ; Tue, 6 Jun 2023 12:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232900AbjFFMfG (ORCPT ); Tue, 6 Jun 2023 08:35:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237492AbjFFMey (ORCPT ); Tue, 6 Jun 2023 08:34:54 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D3210C6 for ; Tue, 6 Jun 2023 05:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=06+UhoP5TamLGqopMxPqWomezmwFuSmat4VeYHN/CYo=; t=1686054893; x=1687264493; b=cKgTQ0GoIF9HJebTE7Gh6eFoja8QwqP6ko8ky+/0lUsFmrNHLRwDNguRin2tbCZuTLGfkpB1CPB 2FhaVUslvJD3BcWlh7FuUBG+HoIMcZnqT70qeEm0VuRl9vGwbnVTppbRmV949Dv52NWfSDILC6va6 SCjW64Lwc0WOnF4i+O9HHeqlsL1x40RAyz915TeG6DLnJAX97p9QYUdXOvKO1ExBGEFDJLYeBgBog /HwHKxGL0aXgXhfmSoAjKwxzjXstkNQ2sLXV6aoHbt7na24Uyob3pHvZUd4DXHF2td2EcibSIUxiS gu0lGQ4y+ak/8k7uWTYDFjQfJG6+63XMv9/g==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1q6Vti-00FYss-1Z; Tue, 06 Jun 2023 14:34:50 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 1/2] wifi: cfg80211: fix locking in sched scan stop work Date: Tue, 6 Jun 2023 14:34:47 +0200 Message-Id: <20230606143447.3fb899fe7aba.I16cd047ee371b7ea34822cc84fd51a09e9778d8f@changeid> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg This should use wiphy_lock() now instead of acquiring the RTNL, since cfg80211_stop_sched_scan_req() now needs that. Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") Signed-off-by: Johannes Berg --- net/wireless/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/wireless/core.c b/net/wireless/core.c index 5b0c4d5b80cf..b3ec9eaec36b 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -368,12 +368,12 @@ static void cfg80211_sched_scan_stop_wk(struct work_struct *work) rdev = container_of(work, struct cfg80211_registered_device, sched_scan_stop_wk); - rtnl_lock(); + wiphy_lock(&rdev->wiphy); list_for_each_entry_safe(req, tmp, &rdev->sched_scan_req_list, list) { if (req->nl_owner_dead) cfg80211_stop_sched_scan_req(rdev, req, false); } - rtnl_unlock(); + wiphy_unlock(&rdev->wiphy); } static void cfg80211_propagate_radar_detect_wk(struct work_struct *work) From patchwork Tue Jun 6 12:34:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 690515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7889C77B7A for ; Tue, 6 Jun 2023 12:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234231AbjFFMfH (ORCPT ); Tue, 6 Jun 2023 08:35:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237486AbjFFMey (ORCPT ); Tue, 6 Jun 2023 08:34:54 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8B1C10C3 for ; Tue, 6 Jun 2023 05:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=WqjL5yyHzRtngED1gZIYy34CpUDhDaZeCYROUGK0tvw=; t=1686054893; x=1687264493; b=mY2K4cQrvkBme56yMZhVCo/lSOQBWxPYvvym5v3jx33OhdC TlgdXbB3MgZ8ItAxvVqGHFVw8BjwN2hk0eOl2kD9V+zbsRGgTkGyGuBPZBJEb/qUk4wBV1z+YS5MF ME52SVMbT7+tDE5oCp4cF3jfK6cGMc12INMjWGBbz2c0ehDn88FinJ1pu33533wpSKBc21fgTM/BN oUUHgTqNh1mbidYS6faj7gq6n/m+XV/oPAYhKa/tJ1lVTnolXvx/rvb7wr6P8D7wB9XVAWu79WjZx OfdiQTt1XGTmPl7NkoUkhzvynXjG80W8LkFr/67vmdDWGNEC6YaPv4gPnH783Unw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1q6Vti-00FYss-2R; Tue, 06 Jun 2023 14:34:50 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 2/2] wifi: cfg80211: fix locking in regulatory disconnect Date: Tue, 6 Jun 2023 14:34:48 +0200 Message-Id: <20230606143447.4a1050335c13.Idc40d8c530615a12a3f8a601c4dc8e59c9480927@changeid> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606143447.3fb899fe7aba.I16cd047ee371b7ea34822cc84fd51a09e9778d8f@changeid> References: <20230606143447.3fb899fe7aba.I16cd047ee371b7ea34822cc84fd51a09e9778d8f@changeid> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg This should use wiphy_lock() now instead of requiring the RTNL, since __cfg80211_leave() via cfg80211_leave() is now requiring that lock to be held. Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") Signed-off-by: Johannes Berg --- net/wireless/reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 0d40d6af7e10..949e1fb3bec6 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2440,11 +2440,11 @@ static void reg_leave_invalid_chans(struct wiphy *wiphy) struct wireless_dev *wdev; struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); - ASSERT_RTNL(); - + wiphy_lock(wiphy); list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) if (!reg_wdev_chan_valid(wiphy, wdev)) cfg80211_leave(rdev, wdev); + wiphy_unlock(wiphy); } static void reg_check_chans_work(struct work_struct *work)