summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2018-11-25 12:47:13 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2018-11-27 02:48:12 +0300
commit53ca0f2fec39c80ccd19e6e3f30cc8daef174b70 (patch)
treed143e0e9bdcb026745c358ad96e8853bdcfd2896 /net
parent095faf45e64be00bff4da2d6182dface3d69c9b7 (diff)
downloadlinux-53ca0f2fec39c80ccd19e6e3f30cc8daef174b70.tar.xz
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: 31568ec09ea0 ("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>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_conncount.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c
index 8acae4a3e4c0..b6d0f6deea86 100644
--- a/net/netfilter/nf_conncount.c
+++ b/net/netfilter/nf_conncount.c
@@ -323,11 +323,8 @@ static void tree_nodes_free(struct rb_root *root,
while (gc_count) {
rbconn = gc_nodes[--gc_count];
spin_lock(&rbconn->list.list_lock);
- if (rbconn->list.count == 0 && rbconn->list.dead == false) {
- rbconn->list.dead = true;
- rb_erase(&rbconn->node, root);
- call_rcu(&rbconn->rcu_head, __tree_nodes_free);
- }
+ rb_erase(&rbconn->node, root);
+ call_rcu(&rbconn->rcu_head, __tree_nodes_free);
spin_unlock(&rbconn->list.list_lock);
}
}