Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8038f92d authored by Taehee Yoo's avatar Taehee Yoo Committed by Greg Kroah-Hartman
Browse files

netfilter: nf_conncount: remove wrong condition check routine



[ Upstream commit 53ca0f2fec39c80ccd19e6e3f30cc8daef174b70 ]

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: default avatarTaehee Yoo <ap420073@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5517d4c6
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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);
		}
		spin_unlock(&rbconn->list.list_lock);
	}
}