Skip to content

Commit 13990f8

Browse files
jrfastabdavem330
authored andcommitted
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 <[email protected]> Acked-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 82a470f commit 13990f8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/sched/cls_cgroup.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,8 @@ static void cls_cgroup_destroy(struct tcf_proto *tp)
156156
struct cls_cgroup_head *head = rtnl_dereference(tp->root);
157157

158158
if (head) {
159-
tcf_exts_destroy(&head->exts);
160-
tcf_em_tree_destroy(&head->ematches);
161159
RCU_INIT_POINTER(tp->root, NULL);
162-
kfree_rcu(head, rcu);
160+
call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
163161
}
164162
}
165163

0 commit comments

Comments
 (0)