Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp83383pxv; Tue, 13 Jul 2021 22:37:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGA9Lc2ZPTdDru1fENQWz/WJPOOvKRI/81qOOJwptoszN8/yJLuXcTjgG4UQk1zp+aRr8n X-Received: by 2002:a05:6638:1204:: with SMTP id n4mr7274102jas.135.1626241062588; Tue, 13 Jul 2021 22:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626241062; cv=none; d=google.com; s=arc-20160816; b=NomuxUItRM0h3N1Uk3tYjUZjcLV14Jnk9Xv+IDPGVIekPsIhBfIC+FhewARptiC+NB XTzUsoy/eridyu1G9paDljtRgYRXFAwjXaUFRS/0IDIiAXwjKy8B0Ls9wgT+xiod7x9j MmuCJfGNERgtEorEouxX2OBpdat4mit05UuBKztCSNajSMUXy9FhzXqPWLwmmlbzSFJf bp0o4iCvGJTi2xHN6YJXnLwUkPJmuQ+nJ7v8OcEgYV6hJTHQooVClZKCOd3tmsiuZiWJ FiGo6y7w/DU+Ob6N/4ZfrHarDUhKKCYY8LNhuA7EXD4V+bW9oblxUk8edg9D0uTU5b2R XDvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=r6yK8a0lQ9oFfMwYPaayXTDheD4SKRj9alAFsalzIjo=; b=qzgcmprYOnZpjPM3IqQTJbrenIc10UlijGWCVe4vx80JVU2+7VoMHKdIlhIVGvBGFd Jd1vHGHu22pSiekwPvq5JLSg0eYFRJdnkkIttNmzdIQ6b9nr2wkLtr7MjeeqrKka3sWq 4BIEvwjchivM1UMFQGPZmPKiYxhnTDhapbg7Iv84e0LnRUJT2TncPhuhWWoJYDoeEGxX jANxpb/JiTdBuDKxoVVso7BaaAtmO21NrimzsOLgj2N+mwp0gEsVBR5G2VsRZoW/TXrv SVGkCIlYIgnNffQzLsWwLvFSmMg+653MjD4mEuyFFNuQ+bQ2HV7QjESeafPCPbfLGy4X J5nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si1370389ilj.131.2021.07.13.22.37.15; Tue, 13 Jul 2021 22:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237903AbhGNFjs (ORCPT + 99 others); Wed, 14 Jul 2021 01:39:48 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:35206 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237887AbhGNFjr (ORCPT ); Wed, 14 Jul 2021 01:39:47 -0400 X-UUID: d5146e83e03f48b9ae9fccf555cc0c50-20210714 X-UUID: d5146e83e03f48b9ae9fccf555cc0c50-20210714 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1689212328; Wed, 14 Jul 2021 13:36:54 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 14 Jul 2021 13:36:52 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 14 Jul 2021 13:36:52 +0800 From: Ryder Lee To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , , Ryder Lee Subject: [PATCH 1/3] mt76 mt7915: take RCU read lock when calling ieee80211_bss_get_elem() Date: Wed, 14 Jul 2021 13:36:49 +0800 Message-ID: <510ef14986079c731ea2879b3095831b60e4f648.1626240767.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As ieee80211_bss_get_elem() derefences an RCU to return ssid_ie, both the call to this function and any operation on this variable need protection by the RCU read lock. Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 863aa18b3024..4d2e5b5e6389 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -923,12 +923,15 @@ static void mt7915_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy, struct mt7915_he_obss_narrow_bw_ru_data *data = _data; const struct element *elem; + rcu_read_lock(); elem = ieee80211_bss_get_elem(bss, WLAN_EID_EXT_CAPABILITY); if (!elem || elem->datalen < 10 || !(elem->data[10] & WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT)) data->tolerated = false; + + rcu_read_unlock(); } static bool mt7915_check_he_obss_narrow_bw_ru(struct ieee80211_hw *hw, -- 2.29.2