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: ddf97ccdd7
("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>
此提交包含在:
@@ -334,7 +334,7 @@ static __net_init int ipt_init_net(struct net *net)
|
||||
{
|
||||
struct tc_action_net *tn = net_generic(net, ipt_net_id);
|
||||
|
||||
return tc_action_net_init(tn, &act_ipt_ops);
|
||||
return tc_action_net_init(tn, &act_ipt_ops, net);
|
||||
}
|
||||
|
||||
static void __net_exit ipt_exit_net(struct net *net)
|
||||
@@ -384,7 +384,7 @@ static __net_init int xt_init_net(struct net *net)
|
||||
{
|
||||
struct tc_action_net *tn = net_generic(net, xt_net_id);
|
||||
|
||||
return tc_action_net_init(tn, &act_xt_ops);
|
||||
return tc_action_net_init(tn, &act_xt_ops, net);
|
||||
}
|
||||
|
||||
static void __net_exit xt_exit_net(struct net *net)
|
||||
|
新增問題並參考
封鎖使用者