From patchwork Wed Jul 13 09:44:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 590351 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 01703CCA482 for ; Wed, 13 Jul 2022 09:45:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234478AbiGMJpi (ORCPT ); Wed, 13 Jul 2022 05:45:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235849AbiGMJpN (ORCPT ); Wed, 13 Jul 2022 05:45:13 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03146EEAB6 for ; Wed, 13 Jul 2022 02:45:13 -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=bN1O9RYWnDxvqRmINA80nozgfqSNrt4VcbHV3moRdYM=; t=1657705513; x=1658915113; b=Co9A5g9HkGlL6vErtaR1s9A/rireGZcPmchCFKhb9euATrA kN6g/ZgFjRg4ji+msfTsLkx1AI7IVnRMxUO+KoVTRcJaDuqx+veWeyKbMtXrXXDlngsWvZLBN6WpR eMPfNZT7l1dnGvVi8rv11Rh/MHgEP24/dMouns8FjQsgYnCZuDGmldvIkC3v1eKY2h/7lxbZBYW2x KNPcIsbCiftwM/Cl6Mgy2cUlMWlzKYSuMuwSmP+1GUOs+DE3jd0SVoz1adNrBCmqgEBJKgTbn04AM PQywJinyYsQbAbu3f2LsM5+43XfvZIO8one224ljU4Ot4hVK0Q6FXzPeqclDSKcw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1oBYvf-00EgvB-Aj; Wed, 13 Jul 2022 11:45:11 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 23/76] wifi: nl80211: acquire wdev mutex for dump_survey Date: Wed, 13 Jul 2022 11:44:09 +0200 Message-Id: <20220713114425.144225d04e6e.I8aec1b25f42c4977ab5f4e4a0286eba551d3e13f@changeid> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220713094502.163926-1-johannes@sipsolutions.net> References: <20220713094502.163926-1-johannes@sipsolutions.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg At least the quantenna driver calls wdev_chandef() here which now requires the lock, so acquire it. Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index b50ba1803595..886d964242ae 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10233,7 +10233,9 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) } while (1) { + wdev_lock(wdev); res = rdev_dump_survey(rdev, wdev->netdev, survey_idx, &survey); + wdev_unlock(wdev); if (res == -ENOENT) break; if (res)