linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Pass lockdep expression to RCU lists
@ 2020-02-19  9:11 Amol Grover
  2020-02-19  9:13 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Amol Grover @ 2020-02-19  9:11 UTC (permalink / raw)
  To: Johannes Berg, David S . Miller, Jakub Kicinski
  Cc: linux-wireless, netdev, linux-kernel, linux-kernel-mentees,
	Joel Fernandes, Madhuparna Bhowmik, Paul E . McKenney,
	Amol Grover

rdev->sched_scan_req_list maybe traversed using list_for_each_entry_rcu
outside an RCU read-side critical section but under the protection
of rtnl_mutex.

Hence, add corresponding lockdep expression to silence false-positive
warnings, and harden RCU lists.

Signed-off-by: Amol Grover <frextrite@gmail.com>
---
 net/wireless/scan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index aef240fdf8df..7f1af8f347b1 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -556,9 +556,8 @@ cfg80211_find_sched_scan_req(struct cfg80211_registered_device *rdev, u64 reqid)
 {
 	struct cfg80211_sched_scan_request *pos;
 
-	WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());
-
-	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list) {
+	list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list,
+				lockdep_rtnl_is_held()) {
 		if (pos->reqid == reqid)
 			return pos;
 	}
-- 
2.24.1


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

end of thread, other threads:[~2020-02-19 21:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19  9:11 [PATCH] cfg80211: Pass lockdep expression to RCU lists Amol Grover
2020-02-19  9:13 ` Johannes Berg
2020-02-19 12:47   ` Paul E. McKenney
2020-02-19 21:27   ` Arend Van Spriel
2020-02-19 21:29     ` Johannes Berg
2020-02-19 21:33       ` Arend Van Spriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).