All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection
@ 2022-05-19 21:27 Johannes Berg
  2022-05-19 21:27 ` [PATCH v2 2/3] mac80211: remove cipher scheme support Johannes Berg
  2022-05-19 21:27 ` [PATCH v2 3/3] mac80211: refactor some key code Johannes Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Berg @ 2022-05-19 21:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This is needed since it might use (and pass out) pointers to
e.g. keys protected by RCU. Can't really happen here as the
frames aren't encrypted, but we need to still adhere to the
rules.

Fixes: cacfddf82baf ("mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/mac80211_hwsim.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4689db129aec..2f746eb64507 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2478,11 +2478,13 @@ static void hw_scan_work(struct work_struct *work)
 			if (req->ie_len)
 				skb_put_data(probe, req->ie, req->ie_len);
 
+			rcu_read_lock();
 			if (!ieee80211_tx_prepare_skb(hwsim->hw,
 						      hwsim->hw_scan_vif,
 						      probe,
 						      hwsim->tmp_chan->band,
 						      NULL)) {
+				rcu_read_unlock();
 				kfree_skb(probe);
 				continue;
 			}
@@ -2490,6 +2492,7 @@ static void hw_scan_work(struct work_struct *work)
 			local_bh_disable();
 			mac80211_hwsim_tx_frame(hwsim->hw, probe,
 						hwsim->tmp_chan);
+			rcu_read_unlock();
 			local_bh_enable();
 		}
 	}
-- 
2.36.1


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

end of thread, other threads:[~2022-05-26  2:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 21:27 [PATCH v2 1/3] mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection Johannes Berg
2022-05-19 21:27 ` [PATCH v2 2/3] mac80211: remove cipher scheme support Johannes Berg
2022-05-19 21:27 ` [PATCH v2 3/3] mac80211: refactor some key code Johannes Berg
2022-05-26  2:42   ` [mac80211] 13d5c8ebd3: hwsim.dpp_pfs_errors.fail kernel test robot
2022-05-26  2:42     ` kernel test robot

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.