Skip to content

Commit b135fc0

Browse files
frextriteummakynes
authored andcommitted
netfilter: ipset: Pass lockdep expression to RCU lists
ip_set_type_list is traversed using list_for_each_entry_rcu outside an RCU read-side critical section but under the protection of ip_set_type_mutex. Hence, add corresponding lockdep expression to silence false-positive warnings, and harden RCU lists. Signed-off-by: Amol Grover <frextrite@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 7fb6f78 commit b135fc0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/ipset/ip_set_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ find_set_type(const char *name, u8 family, u8 revision)
8686
{
8787
struct ip_set_type *type;
8888

89-
list_for_each_entry_rcu(type, &ip_set_type_list, list)
89+
list_for_each_entry_rcu(type, &ip_set_type_list, list,
90+
lockdep_is_held(&ip_set_type_mutex))
9091
if (STRNCMP(type->name, name) &&
9192
(type->family == family ||
9293
type->family == NFPROTO_UNSPEC) &&

0 commit comments

Comments
 (0)