linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcp, ulp: Pass lockdep expression to RCU lists
@ 2020-02-21 15:15 Amol Grover
  2020-02-24 21:02 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Amol Grover @ 2020-02-21 15:15 UTC (permalink / raw)
  To: Eric Dumazet, David S . Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI, Jakub Kicinski
  Cc: linux-kernel, linux-kernel-mentees, Joel Fernandes,
	Madhuparna Bhowmik, Paul E . McKenney, netdev, Amol Grover

tcp_ulp_list is traversed using list_for_each_entry_rcu
outside an RCU read-side critical section but under the protection
of tcp_ulp_list_lock.

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

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

diff --git a/net/ipv4/tcp_ulp.c b/net/ipv4/tcp_ulp.c
index 38d3ad141161..b9e55759054e 100644
--- a/net/ipv4/tcp_ulp.c
+++ b/net/ipv4/tcp_ulp.c
@@ -22,7 +22,8 @@ static struct tcp_ulp_ops *tcp_ulp_find(const char *name)
 {
 	struct tcp_ulp_ops *e;
 
-	list_for_each_entry_rcu(e, &tcp_ulp_list, list) {
+	list_for_each_entry_rcu(e, &tcp_ulp_list, list,
+				lockdep_is_held(&tcp_ulp_list_lock)) {
 		if (strcmp(e->name, name) == 0)
 			return e;
 	}
-- 
2.24.1


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

* Re: [PATCH] tcp, ulp: Pass lockdep expression to RCU lists
  2020-02-21 15:15 [PATCH] tcp, ulp: Pass lockdep expression to RCU lists Amol Grover
@ 2020-02-24 21:02 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-02-24 21:02 UTC (permalink / raw)
  To: frextrite
  Cc: edumazet, kuznet, yoshfuji, kuba, linux-kernel,
	linux-kernel-mentees, joel, madhuparnabhowmik10, paulmck, netdev

From: Amol Grover <frextrite@gmail.com>
Date: Fri, 21 Feb 2020 20:45:38 +0530

> tcp_ulp_list is traversed using list_for_each_entry_rcu
> outside an RCU read-side critical section but under the protection
> of tcp_ulp_list_lock.
> 
> Hence, add corresponding lockdep expression to silence false-positive
> warnings, and harden RCU lists.t
> 
> Signed-off-by: Amol Grover <frextrite@gmail.com>

Applied.

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 15:15 [PATCH] tcp, ulp: Pass lockdep expression to RCU lists Amol Grover
2020-02-24 21:02 ` David Miller

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).