From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH net-next 1/4] net: rtnetlink: support for fdb get Date: Fri, 14 Dec 2018 13:03:12 -0800 Message-ID: <20181214130312.1d835d2f@cakuba.netronome.com> References: <1544809401-42289-1-git-send-email-roopa@cumulusnetworks.com> <1544809401-42289-2-git-send-email-roopa@cumulusnetworks.com> <6daaa7f9-41db-30da-043c-0b34bc16bc72@cumulusnetworks.com> <20181214113722.1c8638c6@cakuba.netronome.com> <20181214115421.545038a2@cakuba.netronome.com> <024f717e-20d8-bd18-9ae9-586165f50ec8@cumulusnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Roopa Prabhu , David Miller , netdev , Nikolay Aleksandrov , Stephen Hemminger To: David Ahern Return-path: Received: from mail-qk1-f195.google.com ([209.85.222.195]:36107 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730952AbeLNVDS (ORCPT ); Fri, 14 Dec 2018 16:03:18 -0500 Received: by mail-qk1-f195.google.com with SMTP id o125so4066867qkf.3 for ; Fri, 14 Dec 2018 13:03:17 -0800 (PST) In-Reply-To: <024f717e-20d8-bd18-9ae9-586165f50ec8@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 14 Dec 2018 12:58:13 -0700, David Ahern wrote: > On 12/14/18 12:54 PM, Jakub Kicinski wrote: > > On Fri, 14 Dec 2018 12:42:21 -0700, David Ahern wrote: > >> On 12/14/18 12:37 PM, Jakub Kicinski wrote: > >>> Oh, so we'd use the STRICT checking in doit for the first time? I > >>> better send that rename patch then.. > >> > >> IMHO, no. The flag is for older userspace that could be sending junk in > >> the request. All new code should do strict checking without the flag set > >> to ensure only proper requests are handled. > > > > I'm going back and forth on that in my head. IDK if new user space > > shouldn't be able to do a get request on an old kernel which doesn't > > understand some of the attributes. Grey area.. perhaps it needs to be > > decided on case by case basis? For my stats work I think returning too > > many stats if what is affectively a filter is not understood may be a > > good option. Perhaps for fdb get it makes more sense to error out. > > hmm.. > > I am referring to new code as in what Roopa is doing here -- adding a > whole new feature (support for RTM_GETNEIGH for PF_BRIDGE). There is no > support today, so no way it impacts existing userspace. > > In cases where there is a handler for the operation, then, yes, the > strict flag is needed for any new kernel side filtering to ensure the > request is parsed properly. Ack. So for those new handlers we would never allow the behaviour of ignoring unknown attributes? Perhaps I'm over-thinking this, but maybe we should then just require the STRICT flag on the socket, and if not set return -EINVAL? Slightly more consistent behaviour, and it gives us a clean way out if someone has a strong use case for ignoring the attributes. Just spit balling here, I'm happy either way.