Skip to content

Commit f998b6b

Browse files
Jozsef Kadlecsikummakynes
authored andcommitted
netfilter: ipset: Missing nfnl_lock()/nfnl_unlock() is added to ip_set_net_exit()
Patch "netfilter: ipset: use nfnl_mutex_is_locked" is added the real mutex locking check, which revealed the missing locking in ip_set_net_exit(). Signed-off-by: Jozsef Kadlecsik <[email protected]> Reported-by: [email protected] Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 4750005 commit f998b6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/ipset/ip_set_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,13 +2078,15 @@ ip_set_net_exit(struct net *net)
20782078

20792079
inst->is_deleted = true; /* flag for ip_set_nfnl_put */
20802080

2081+
nfnl_lock(NFNL_SUBSYS_IPSET);
20812082
for (i = 0; i < inst->ip_set_max; i++) {
20822083
set = ip_set(inst, i);
20832084
if (set) {
20842085
ip_set(inst, i) = NULL;
20852086
ip_set_destroy_set(set);
20862087
}
20872088
}
2089+
nfnl_unlock(NFNL_SUBSYS_IPSET);
20882090
kfree(rcu_dereference_protected(inst->ip_set_list, 1));
20892091
}
20902092

0 commit comments

Comments
 (0)