All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mt76 mt7915: take RCU read lock when calling ieee80211_bss_get_elem()
@ 2021-07-14  5:36 ` Ryder Lee
  0 siblings, 0 replies; 11+ messages in thread
From: Ryder Lee @ 2021-07-14  5:36 UTC (permalink / raw)
  To: Felix Fietkau
  Cc: Lorenzo Bianconi, Shayne Chen, Evelyn Tsai, linux-wireless,
	linux-mediatek, Ryder Lee

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 <ryder.lee@mediatek.com>
---
 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
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-07-14  8:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-14  5:36 [PATCH 1/3] mt76 mt7915: take RCU read lock when calling ieee80211_bss_get_elem() Ryder Lee
2021-07-14  5:36 ` Ryder Lee
2021-07-14  5:36 ` [PATCH 2/3] mt76: mt7915: report tx rate directly from tx status Ryder Lee
2021-07-14  5:36   ` Ryder Lee
2021-07-14  8:02   ` kernel test robot
2021-07-14  8:02     ` kernel test robot
2021-07-14  8:02     ` kernel test robot
2021-07-14  5:36 ` [PATCH 3/3] mt76: mt7915: remove mt7915_sta_stats Ryder Lee
2021-07-14  5:36   ` Ryder Lee
2021-07-14  7:31 ` [PATCH 1/3] mt76 mt7915: take RCU read lock when calling ieee80211_bss_get_elem() Johannes Berg
2021-07-14  7:31   ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.