From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Abeni Subject: Re: [PATCH net-next v5 1/4] net/sched: user-space can't set unknown tcfa_action values Date: Mon, 30 Jul 2018 18:41:36 +0200 Message-ID: References: <951ad078ad4d5ee108abcd85189460aed7948634.1532934532.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Cong Wang , Jiri Pirko , Daniel Borkmann , Marcelo Ricardo Leitner , Eyal Birger , "David S. Miller" To: Jamal Hadi Salim , netdev@vger.kernel.org Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60806 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727667AbeG3SR2 (ORCPT ); Mon, 30 Jul 2018 14:17:28 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: 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 = TC_ACT_UNSPEC; > > + } > > + > > return a; > > > > > I think it would make a lot more sense to just reject the entry than > changing it underneath the user to a default value. Least element of > suprise. I fear that would break existing (bad) users ?!? This way, such users are notified they are doing something uncorrect, but still continue to work. The patch can be changed to reject bad actions, if there is agreement, but it would not look as the safest way to me. Thanks, Paolo