]> granicus.if.org Git - ipset/commitdiff
netfilter: ipset: use nfnl_mutex_is_locked
authorFlorian Westphal <fw@strlen.de>
Thu, 30 Nov 2017 20:07:32 +0000 (21:07 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 4 Jan 2018 12:25:37 +0000 (13:25 +0100)
Check that we really hold nfnl mutex here instead of relying on correct
usage alone.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
kernel/net/netfilter/ipset/ip_set_core.c

index d25dd463a63261e57060b392c08f300dbb3d17f9..6fbbaeaa77e61ec263757781cfaf5491f65e9131 100644 (file)
@@ -62,7 +62,7 @@ MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET);
 
 /* When the nfnl mutex is held: */
 #define ip_set_dereference(p)          \
-       rcu_dereference_protected(p, 1)
+       rcu_dereference_protected(p, lockdep_nfnl_is_held(NFNL_SUBSYS_IPSET))
 #define ip_set(inst, id)               \
        ip_set_dereference((inst)->ip_set_list)[id]