summaryrefslogtreecommitdiffstats
path: root/net/sched/act_simple.c
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2017-11-01 10:23:50 -0700
committerDavid S. Miller <davem@davemloft.net>2017-11-03 10:30:38 +0900
commitceffcc5e254b450e6159f173e4538215cebf1b59 (patch)
treee774e0c77b5f8a2979794ed08cc93b6365852114 /net/sched/act_simple.c
parenta159d3c4b8291998c018f0dbddd4678315264a1e (diff)
downloadlinux-ceffcc5e254b450e6159f173e4538215cebf1b59.tar.gz
linux-ceffcc5e254b450e6159f173e4538215cebf1b59.tar.bz2
linux-ceffcc5e254b450e6159f173e4538215cebf1b59.zip
net_sched: hold netns refcnt for each action
TC actions have been destroyed asynchronously for a long time, previously in a RCU callback and now in a workqueue. If we don't hold a refcnt for its netns, we could use the per netns data structure, struct tcf_idrinfo, after it has been freed by netns workqueue. Hold refcnt to ensure netns destroy happens after all actions are gone. Fixes: ddf97ccdd7cb ("net_sched: add network namespace support for tc actions") Reported-by: Lucas Bates <lucasb@mojatatu.com> Tested-by: Lucas Bates <lucasb@mojatatu.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_simple.c')
-rw-r--r--net/sched/act_simple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index e7b57e5071a3..a8d0ea95f894 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -201,7 +201,7 @@ static __net_init int simp_init_net(struct net *net)
{
struct tc_action_net *tn = net_generic(net, simp_net_id);
- return tc_action_net_init(tn, &act_simp_ops);
+ return tc_action_net_init(tn, &act_simp_ops, net);
}
static void __net_exit simp_exit_net(struct net *net)