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

2018-08-01 Thread Jamal Hadi Salim
On 31/07/18 10:40 AM, Paolo Abeni wrote: If we choose to reject unknown opcodes, such user-space configuration will fail. I think that is a good thing. The kernel should not be accepting things it doesnt understand. This is a good opportunity to enforce that. What would happen before this p

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

2018-07-31 Thread Paolo Abeni
On Tue, 2018-07-31 at 09:53 -0400, Jamal Hadi Salim wrote: > BTW, I asked this earlier and Jiri said it was addressed in patch 2. > I just looked again and i may be missing something basic: > Lets say tomorrow in a new kernel we add new TC_ACT_XXX that then gets > exposed to uapi - so user space t

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

2018-07-31 Thread Jamal Hadi Salim
On 31/07/18 05:41 AM, Paolo Abeni wrote: Before this patch, the kernel exposed the same behaviour for negative value of 'bar', while, for positive 'bar' values, the overall behaviour was more complex (some classifier always stops with unknown positive action value, others go to lower prio). >

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

2018-07-31 Thread Paolo Abeni
On Mon, 2018-07-30 at 15:31 -0400, Jamal Hadi Salim wrote: > On 30/07/18 12:41 PM, Paolo Abeni wrote: > > On Mon, 2018-07-30 at 10:03 -0400, Jamal Hadi Salim wrote: > > > On 30/07/18 08:30 AM, Paolo Abeni wrote: > > > > } > > > > > > > > + if (!tcf_action_valid(a->tcfa_action)) {

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

2018-07-30 Thread Jamal Hadi Salim
On 30/07/18 12:41 PM, Paolo Abeni wrote: On Mon, 2018-07-30 at 10:03 -0400, Jamal Hadi Salim wrote: On 30/07/18 08:30 AM, Paolo Abeni wrote: } + if (!tcf_action_valid(a->tcfa_action)) { + NL_SET_ERR_MSG(extack, "invalid action value, using TC_ACT_UNSPEC instead"); +

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

2018-07-30 Thread Paolo Abeni
On Mon, 2018-07-30 at 10:03 -0400, Jamal Hadi Salim wrote: > On 30/07/18 08:30 AM, Paolo Abeni wrote: > > } > > > > + if (!tcf_action_valid(a->tcfa_action)) { > > + NL_SET_ERR_MSG(extack, "invalid action value, using > > TC_ACT_UNSPEC instead"); > > + a->tcfa_action =

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

2018-07-30 Thread Jiri Pirko
Mon, Jul 30, 2018 at 04:03:50PM CEST, j...@mojatatu.com wrote: >On 30/07/18 08:30 AM, Paolo Abeni wrote: >> } >> +if (!tcf_action_valid(a->tcfa_action)) { >> +NL_SET_ERR_MSG(extack, "invalid action value, using >> TC_ACT_UNSPEC instead"); >> +a->tcfa_action = TC_AC

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

2018-07-30 Thread Jamal Hadi Salim
On 30/07/18 08:30 AM, Paolo Abeni wrote: } + if (!tcf_action_valid(a->tcfa_action)) { + NL_SET_ERR_MSG(extack, "invalid action value, using TC_ACT_UNSPEC instead"); + a->tcfa_action = TC_ACT_UNSPEC; + } + return a; I think it would make

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

2018-07-30 Thread Jiri Pirko
Mon, Jul 30, 2018 at 02:30:42PM CEST, pab...@redhat.com wrote: >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 f

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

2018-07-30 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 th