Skip to content

Commit 53ca0f2

Browse files
TaeheeYooummakynes
authored andcommitted
netfilter: nf_conncount: remove wrong condition check routine
All lists that reach the tree_nodes_free() function have both zero counter and true dead flag. The reason for this is that lists to be release are selected by nf_conncount_gc_list() which already decrements the list counter and sets on the dead flag. Therefore, this if statement in tree_nodes_free() is unnecessary and wrong. Fixes: 31568ec ("netfilter: nf_conncount: fix list_del corruption in conn_free") Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 095faf4 commit 53ca0f2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

net/netfilter/nf_conncount.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,8 @@ static void tree_nodes_free(struct rb_root *root,
323323
while (gc_count) {
324324
rbconn = gc_nodes[--gc_count];
325325
spin_lock(&rbconn->list.list_lock);
326-
if (rbconn->list.count == 0 && rbconn->list.dead == false) {
327-
rbconn->list.dead = true;
328-
rb_erase(&rbconn->node, root);
329-
call_rcu(&rbconn->rcu_head, __tree_nodes_free);
330-
}
326+
rb_erase(&rbconn->node, root);
327+
call_rcu(&rbconn->rcu_head, __tree_nodes_free);
331328
spin_unlock(&rbconn->list.list_lock);
332329
}
333330
}

0 commit comments

Comments
 (0)