Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2893331pxb; Tue, 24 Aug 2021 10:02:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSWGrp2g2HEPHTQsE2VR1socUvpcfhiCu9ZlRb2yATVTDMD14lXzmmpUCj/QA/wsR6+d4P X-Received: by 2002:aa7:dd93:: with SMTP id g19mr3562031edv.262.1629824521701; Tue, 24 Aug 2021 10:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824521; cv=none; d=google.com; s=arc-20160816; b=Kw/Wkr+QZfSWYEg96cFV8a3RB8ppuSeSBmWiUeQ0djSeRd6MC+hIA4d8C1QdFGhF0q NGS9+AoACvTPwpnLiLgcV1R1x2JourLk78QM3bWkitJa3UlmSSNHUxwPpZ/10Lj86Y0S wkTOdA6QXTHD28Kuoa197e7FY2imub6cX7iDq7J8rc8fbp2IsXFzYj72IgAz7iYuOYMz 7pzMNz9SH8as/FdI78I3Lzhkpew8vSJPocCwln+jGOg7UgdzE4weyh1rf7iBJ/ukVjbV RfOvac+dSNpoS3I9I5y+kMQidlJuTylO10aDvbWTX0Bet0wYpkJaOKtVdgGtpaeWibAf 8xPw== 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=snIvyEtetTstnU56ULOeaxO+bnK/2Myhq8I1iLZxBLc=; b=he/vU7aQet1ErEe5A+IteVzRkxlhCwU7FV2lbF/glY8WW74qGapNQw8OYdbBf2OjPT K5oXhsEzR3+pAMYTt6C15PcHACZBu0l5N7EXO86YythswRd9veGGkJlC71OYBknd+Cl8 PTFEY1yEruBxH9cbZn5sjWxAlrgLUNLYa8GTxCxJC0usrMIjFpa72+O0ZrU+Eh1yJ4oq pl9SxgfkeVFpcm1Y4diQOL9AGJtVADtlql5mY0magXdKCZd0Re2tNKZlSOxYN2EnuHZy sbXna+/1J7X/z5Zhyad8ALXYm3LKlWY+il/5uRkHPnAdQY0AWk8iwqgxJq9ltWpz5ZWd 9klA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lyY+kF8F; 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 u6si20530166eju.564.2021.08.24.10.01.37; Tue, 24 Aug 2021 10:02:01 -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=lyY+kF8F; 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 S238681AbhHXRAr (ORCPT + 99 others); Tue, 24 Aug 2021 13:00:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:39258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237888AbhHXQ6F (ORCPT ); Tue, 24 Aug 2021 12:58:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B572761357; Tue, 24 Aug 2021 16:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824229; bh=iFZD3EUwr3qMB1k2li68u9oMJ2KEEa45qBAseRPycl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lyY+kF8FeunSXko4ZuSmDB6YqXJ117OcqyBpF9aU5OFjEK4vmA8UFzy9hjaOFmmvf Gf67vDGLMlcBm2FMFOoJBenY9tXkoOvf8UiH4XlmixaeNGT0s0Fts8qtDKorNFgPf2 IanNpAJ9G8wrrdqawG9cFD57r/z4c81pJTx9gp5WyvhWj0VLR28jxrud9WtcBe+td6 rhibh9R54Oq6+O8guqygE5ntx4mSOyp6lOwKwKxvO+CTHAlBxASORPJXAqPoO6ShDl MYTH8C29xNckmHpkG2UHMLq9GEGS0iLW89nNEaQMBwBYJ+2ATLcplfGCl8Jsz8eLqs 865OEcGsTGWhg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Johannes Berg , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.13 062/127] mac80211: fix locking in ieee80211_restart_work() Date: Tue, 24 Aug 2021 12:55:02 -0400 Message-Id: <20210824165607.709387-63-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165607.709387-1-sashal@kernel.org> References: <20210824165607.709387-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.13.13-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.13.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.13.13-rc1 X-KernelTest-Deadline: 2021-08-26T16:55+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 276e189f8e4e3cce1634d6bac4ed0d9ca242441b ] Ilan's change to move locking around accidentally lost the wiphy_lock() during some porting, add it back. Fixes: 45daaa131841 ("mac80211: Properly WARN on HW scan before restart") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20210817121210.47bdb177064f.Ib1ef79440cd27f318c028ddfc0c642406917f512@changeid Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/mac80211/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 2481bfdfafd0..efe5c3295455 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -260,6 +260,8 @@ static void ieee80211_restart_work(struct work_struct *work) flush_work(&local->radar_detected_work); rtnl_lock(); + /* we might do interface manipulations, so need both */ + wiphy_lock(local->hw.wiphy); WARN(test_bit(SCAN_HW_SCANNING, &local->scanning), "%s called with hardware scan in progress\n", __func__); -- 2.30.2