netfilter: nf_conncount: use rb_link_node_rcu() instead of rb_link_node()
authorTaehee Yoo <ap420073@gmail.com>
Sat, 8 Dec 2018 02:03:01 +0000 (11:03 +0900)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 13 Dec 2018 00:14:58 +0000 (01:14 +0100)
rbnode in insert_tree() is rcu protected pointer.
So, in order to handle this pointer, _rcu function should be used.
rb_link_node_rcu() is a rcu version of rb_link_node().

Fixes: 34848d5c896e ("netfilter: nf_conncount: Split insert and traversal")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conncount.c

index b6d0f6deea86c34437f997533df3f4f7f4f6bd50..9cd180bda0920304467165cef1365c7291575347 100644 (file)
@@ -427,7 +427,7 @@ insert_tree(struct net *net,
        count = 1;
        rbconn->list.count = count;
 
-       rb_link_node(&rbconn->node, parent, rbnode);
+       rb_link_node_rcu(&rbconn->node, parent, rbnode);
        rb_insert_color(&rbconn->node, root);
 out_unlock:
        spin_unlock_bh(&nf_conncount_locks[hash % CONNCOUNT_LOCK_SLOTS]);