Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-03-08 Thread Davide Caratti
On Thu, 2019-03-07 at 17:56 +0100, Davide Caratti wrote: > On Thu, 2019-03-07 at 14:51 +, Vlad Buslov wrote: > > [...] hi Vlad, > > On Thu 07 Mar 2019 at 15:56, Davide Caratti wrote: > > > so, I think that the answer to your question: > > > > > > On Wed, 2019-02-27 at 17:50 -0800, Cong Wan

Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-03-07 Thread Davide Caratti
On Thu, 2019-03-07 at 14:51 +, Vlad Buslov wrote: [...] > On Thu 07 Mar 2019 at 15:56, Davide Caratti wrote: > > so, I think that the answer to your question: > > > > On Wed, 2019-02-27 at 17:50 -0800, Cong Wang wrote: > > > > > > + if (oldchain) > > > > > > + tcf_chain_

Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-03-07 Thread Vlad Buslov
On Thu 07 Mar 2019 at 15:56, Davide Caratti wrote: > On Fri, 2019-03-01 at 16:04 -0800, Cong Wang wrote: >> > On Fri, Mar 1, 2019 at 10:02 AM Davide Caratti wrote: >> > >> > if I well understand the question, you are worried about >> > tcf_action_goto_chain_exec(), that can dereference 'oldchai

Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-03-07 Thread Davide Caratti
On Fri, 2019-03-01 at 16:04 -0800, Cong Wang wrote: > > On Fri, Mar 1, 2019 at 10:02 AM Davide Caratti wrote: > > > > if I well understand the question, you are worried about > > tcf_action_goto_chain_exec(), that can dereference 'oldchain' while we are > > overwriting the action. A call to tcf_c

Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-03-01 Thread Cong Wang
On Fri, Mar 1, 2019 at 10:02 AM Davide Caratti wrote: > > On Wed, 2019-02-27 at 17:50 -0800, Cong Wang wrote: > > > + if (oldchain) > > > + tcf_chain_put_by_act(oldchain); > > > > Do we need to respect RCU grace period here? > > if I well understand the question, you are worrie

Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-03-01 Thread Davide Caratti
On Wed, 2019-02-27 at 17:50 -0800, Cong Wang wrote: > > + if (oldchain) > > + tcf_chain_put_by_act(oldchain); > > Do we need to respect RCU grace period here? if I well understand the question, you are worried about tcf_action_goto_chain_exec(), that can dereference 'oldchain'

Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-02-27 Thread Cong Wang
On Wed, Feb 27, 2019 at 9:41 AM Davide Caratti wrote: > @@ -108,7 +116,16 @@ static int tcf_csum_init(struct net *net, struct nlattr > *nla, > if (ret == ACT_P_CREATED) > tcf_idr_insert(tn, *a); > > + if (oldchain) > + tcf_chain_put_by_act(oldchain);

[PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-02-27 Thread Davide Caratti
the following script: # tc qdisc add dev crash0 clsact # tc filter add dev crash0 egress matchall action csum icmp pass index 90 # tc actions replace action csum icmp goto chain 42 index 90 \ > cookie c1a0c1a0 # tc actions show action csum had the following output: Error: Failed to init TC