[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b11f899b-bfbf-7205-7b96-b8a974447662@gmail.com>
Date: Thu, 2 May 2019 07:40:25 -0600
From: David Ahern <dsahern@...il.com>
To: Michal Kubecek <mkubecek@...e.cz>,
Johannes Berg <johannes@...solutions.net>
Cc: "David S. Miller" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 3/3] netlink: add validation of NLA_F_NESTED flag
On 5/2/19 7:14 AM, Michal Kubecek wrote:
>>> @@ -1132,6 +1136,10 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
>>> const struct nla_policy *policy,
>>> struct netlink_ext_ack *extack)
>>> {
>>> + if (!(nla->nla_type & NLA_F_NESTED)) {
>>> + NL_SET_ERR_MSG_ATTR(extack, nla, "nested attribute expected");
>>
>> Maybe reword that to say "NLA_F_NESTED is missing" or so? The "nested
>> attribute expected" could result in a lot of headscratching (without
>> looking at the code) because it looks nested if you do nla_nest_start()
>> etc.
>
> How about "NLA_F_NESTED is missing" and "NLA_F_NESTED not expected"?
>
That is much better to me.
Powered by blists - more mailing lists