[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a3626aeca20280e8253b575fe72309b2009474a8.camel@sipsolutions.net>
Date: Fri, 26 Apr 2019 13:23:46 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Michal Kubecek <mkubecek@...e.cz>, netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...il.com>,
Jiri Pirko <jiri@...lanox.com>,
Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
Florian Westphal <fw@...len.de>,
"netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 0/3] make nla_nest_start() add NLA_F_NESTED flag
On Fri, 2019-04-26 at 13:19 +0200, Michal Kubecek wrote:
> On Fri, Apr 26, 2019 at 11:24:15AM +0200, Johannes Berg wrote:
> > On Fri, 2019-04-26 at 09:13 +0000, Michal Kubecek wrote:
> >
> > > Another observation was that even if NLA_F_NESTED flag was introduced in
> > > 2007, only few netlink based interfaces set it in kernel generated messages
> > > and even many recently added APIs omit it. That is unfortunate as without
> > > the flag, message parsers not familiar with attribute semantics cannot
> > > recognize nested attributes and do not see message structure; this affects
> > > e.g. wireshark dissector or mnl_nlmsg_fprintf() from libmnl.
> >
> > Indeed.
> >
> > I wonder if we should also (start) enforcing that the userspace sender
> > side sets this, if the policy is strict?
>
> 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.
Regarding that attribute - I guess we'd have to come up with a policy
flag saying "may or may not be nested" (if it was a new one) or so?
johannes
Powered by blists - more mailing lists