summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2014-10-05 21:28:20 -0700
committerDavid S. Miller <davem@davemloft.net>2014-10-06 18:02:32 -0400
commit13990f8156862fe945a1a226850a6550c8988a33 (patch)
tree9246262a5c0728e0e0f40c5208697cd2dda38126 /net
parent82a470f1119eb7d2e4941b915bf9cd6fd8d54494 (diff)
downloadtalos-op-linux-13990f8156862fe945a1a226850a6550c8988a33.tar.gz
talos-op-linux-13990f8156862fe945a1a226850a6550c8988a33.zip
net: sched: cls_cgroup tear down exts and ematch from rcu callback
It is not RCU safe to destroy the action chain while there is a possibility of readers accessing it. Move this code into the rcu callback using the same rcu callback used in the code patch to make a change to head. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Cong Wang <cwang@twopensource.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/cls_cgroup.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 2f77a89655dc..d61a801222c1 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -156,10 +156,8 @@ static void cls_cgroup_destroy(struct tcf_proto *tp)
struct cls_cgroup_head *head = rtnl_dereference(tp->root);
if (head) {
- tcf_exts_destroy(&head->exts);
- tcf_em_tree_destroy(&head->ematches);
RCU_INIT_POINTER(tp->root, NULL);
- kfree_rcu(head, rcu);
+ call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
}
}
OpenPOWER on IntegriCloud