Re: [PATCH net] net: sched: set xt_tgchk_param par.net properly in ipt_init_target

2017-08-07 Thread Xin Long
On Tue, Aug 8, 2017 at 9:00 AM, Cong Wang wrote: > On Sat, Aug 5, 2017 at 1:48 AM, Xin Long wrote: >> -static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla, >> +static int __tcf_ipt_init(struct net *net, struct nlattr *nla, >>

Re: [PATCH net] net: sched: set xt_tgchk_param par.net properly in ipt_init_target

2017-08-07 Thread Cong Wang
On Sat, Aug 5, 2017 at 1:48 AM, Xin Long wrote: > -static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla, > +static int __tcf_ipt_init(struct net *net, struct nlattr *nla, > struct nlattr *est, struct tc_action **a, >

[PATCH net] net: sched: set xt_tgchk_param par.net properly in ipt_init_target

2017-08-05 Thread Xin Long
Now xt_tgchk_param par in ipt_init_target is a local varibale, par.net is not initialized there. Later when xt_check_target calls target's checkentry in which it may access par.net, it would cause kernel panic. Jaroslav found this panic when running: # ip link add TestIface type dummy # tc