Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp573073yba; Fri, 26 Apr 2019 05:18:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXqYbT3aiE+5OR9GZxqaPV6FGj11TcglCAPjffU8Fy/J5cWt6nilwZci8OhiHKgo9Q3NW4 X-Received: by 2002:a17:902:20c6:: with SMTP id v6mr43498794plg.276.1556281139581; Fri, 26 Apr 2019 05:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556281139; cv=none; d=google.com; s=arc-20160816; b=p77QdpkDgS8pR9d4MwBPWk9AS0rDdFl4Xw80NAC+xzCg+OjASc+OIe+U5tKt7ZHtbk Te6PZeHSFGsWQLCuSm886jm64HPQnfTTd+bZFPl2SpB6WFV79nXFU//HMhUq0DPQCv/N GmT/AhGtYhySyoLIChU+EfbYdWFPIrqy+iEdowcK9nV6y4W0JK5cdKlUCuWOuQKT627T qir1+ozfZN0P0sZxl429Gx5luplpKRE8ByioAze20zVNuQw403N0sVIx1XsQYJJdI/v7 dP2jCrz3sclGzZUJ8+LB9nSXaF/s5pcfHqycD2vJ01HaQ/e/p0DwqVtkL8GjbIy0rZ3R RZrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=4wELgJ4CBAX0YBZbzocf7qXOS1r3L+vcTELo8su2Lbk=; b=E8UaIJ8e4OS9hOO1x2BwVhRpVMroyGI9RP6pPrmroh45j5sEvhzHjSwHCGdW/XTYIs Pk84ihmZ5N7bGotk4bM3LBanY8iBGJPSZf3xFx1Bw/i+WBiTRajh5qYu2AqLeKg3hdMe F9z4V9ebr7++3QfK8m3DBy6nkgK+BtXSsckiYxTnSen4HFahvhelsTDtMz/a8UAcYPSo x0+erWQNYhwrQH0wADLpxEdmx+6BvpQDJpHGGREduHK9zjz6pJog43Ew7BNg5TNfTMiF zKHs7279NyViiEdveE4+X71d31Pc01hoxZt4/2E0ldrlY6ZNskX5+xAeIkT18TpiBg5m wQZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si8103160pgn.190.2019.04.26.05.18.43; Fri, 26 Apr 2019 05:18:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbfDZMRw (ORCPT + 99 others); Fri, 26 Apr 2019 08:17:52 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:57788 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfDZMRv (ORCPT ); Fri, 26 Apr 2019 08:17:51 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hJznT-0004MU-OZ; Fri, 26 Apr 2019 14:17:44 +0200 Message-ID: <18db9ac8b398b215e3523dd5b79c7f86e21864ce.camel@sipsolutions.net> Subject: Re: [PATCH net-next 0/3] make nla_nest_start() add NLA_F_NESTED flag From: Johannes Berg To: Michal Kubecek , netdev@vger.kernel.org Cc: "David S. Miller" , David Ahern , Jiri Pirko , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "netfilter-devel@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Fri, 26 Apr 2019 14:17:42 +0200 In-Reply-To: <20190426115629.GH26549@unicorn.suse.cz> References: <1dcb87486a96785e3b9e6f337392aa904d977a0d.camel@sipsolutions.net> <20190426111954.GG26549@unicorn.suse.cz> <20190426115629.GH26549@unicorn.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-04-26 at 13:56 +0200, Michal Kubecek wrote: > > > I suppose we should, at least the part that attribute with NLA_NESTED > > > policy has NLA_F_NESTED flag. I'm not so sure about the opposite (i.e. > > > that attributes with other policies do not have the flag) as when I was > > > checking where kernel accesses nlattr::nla_type directly rather than > > > with nla_type(), I stumbled upon an attribute NL80211_ATTR_VENDOR_DATA > > > which has policy NLA_BINARY but is sometimes a nest, AFAICS. > > > > I guess anyway we can only do it for *new* things, not really for all > > existing attributes. > > Right... but what I wanted to say is that if there is already (at least) > one attribute which may or may not be a nest, depending on a context, we > should expect there may be also new attributes like that in the future. Yeah, but we can handle that as we see it? I just reposted my strict validation series - maybe we can right now, as it's not released yet, quickly add an NL_VALIDATED_NESTED_FLAG or so to it? Do you want to take a stab at that? I have to go now, but I could check in the next few days. johannes