Re: [Patch net 05/13] cls_cgroup: use tcf_exts_get_net() before call_rcu()

2017-11-09 Thread Cong Wang
On Thu, Nov 9, 2017 at 2:31 PM, Roman Mashak wrote: > Cong Wang writes: >> @@ -124,8 +130,10 @@ static int cls_cgroup_change(struct net *net, struct >> sk_buff *in_skb, >> goto errout; >> >> rcu_assign_pointer(tp->root, new); >> - if (head) >> + if (head) { >> +

Re: [Patch net 05/13] cls_cgroup: use tcf_exts_get_net() before call_rcu()

2017-11-09 Thread Roman Mashak
Cong Wang writes: [...] > static void cls_cgroup_destroy_work(struct work_struct *work) > { > struct cls_cgroup_head *head = container_of(work, > struct cls_cgroup_head, > work); >

[Patch net 05/13] cls_cgroup: use tcf_exts_get_net() before call_rcu()

2017-11-06 Thread Cong Wang
Hold netns refcnt before call_rcu() and release it after the tcf_exts_destroy() is done. Note, on ->destroy() path we have to respect the return value of tcf_exts_get_net(), on other paths it should always return true, so we don't need to care. Cc: Lucas Bates Cc: Jamal Hadi Salim Cc: Jiri Pirk