Re: [PATCH net-next v4 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-07-27 Thread Paolo Abeni
On Thu, 2018-07-26 at 21:28 -0300, Marcelo Ricardo Leitner wrote: > Hi, > > On Thu, Jul 26, 2018 at 04:34:57PM +0200, Paolo Abeni wrote: > ... > > @@ -895,6 +904,14 @@ struct tc_action *tcf_action_init_1(struct net *net, > > struct tcf_proto *tp, > > } > > } > > > > + if

Re: [PATCH net-next v4 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-07-26 Thread Marcelo Ricardo Leitner
Hi, On Thu, Jul 26, 2018 at 04:34:57PM +0200, Paolo Abeni wrote: ... > @@ -895,6 +904,14 @@ struct tc_action *tcf_action_init_1(struct net *net, > struct tcf_proto *tp, > } > } > > + if (!tcf_action_valid(a->tcfa_action)) { > + net_warn_ratelimited("invalid

[PATCH net-next v4 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-07-26 Thread Paolo Abeni
Currently, when initializing an action, the user-space can specify and use arbitrary values for the tcfa_action field. If the value is unknown by the kernel, is implicitly threaded as TC_ACT_UNSPEC. This change explicitly checks for unknown values at action creation time, and explicitly convert