Thread (2 messages) 2 messages, 1 author, 2020-02-23
STALE2294d

[PATCH 1/2] netfilter: Pass lockdep expression to __instance_lookup traversal

From: Amol Grover <hidden>
Date: 2020-02-23 17:20:23
Also in: linux-kernel-mentees, lkml, netfilter-devel
Subsystem: netfilter, networking [general], the rest · Maintainers: Pablo Neira Ayuso, Florian Westphal, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

log->instance_table[] may be traversed outside RCU read-side
critical section but under the protection of log->instances_lock.

Hence, add the corresponding lockdep expression to silence
false-positive warnings.

Signed-off-by: Amol Grover <redacted>
---
 net/netfilter/nfnetlink_log.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 0ba020ca38e6..09acc579b566 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -104,7 +104,8 @@ __instance_lookup(struct nfnl_log_net *log, u_int16_t group_num)
 	struct nfulnl_instance *inst;
 
 	head = &log->instance_table[instance_hashfn(group_num)];
-	hlist_for_each_entry_rcu(inst, head, hlist) {
+	hlist_for_each_entry_rcu(inst, head, hlist,
+				 lockdep_is_held(&log->instances_lock)) {
 		if (inst->group_num == group_num)
 			return inst;
 	}
-- 
2.24.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help