[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9def52e8-89ac-49eb-a2fa-5877d1d638de@kernel.org>
Date: Sat, 9 Mar 2024 10:50:26 -0700
From: David Ahern <dsahern@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>, Petr Machata <petrm@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Ido Schimmel <idosch@...dia.com>, Simon Horman <horms@...nel.org>,
mlxsw@...dia.com
Subject: Re: [PATCH net-next v4 1/7] net: nexthop: Adjust netlink policy
parsing for a new attribute
On 3/9/24 8:02 AM, Eric Dumazet wrote:
>
> ...
>
>> -
>> /* rtnl */
>> static int rtm_del_nexthop(struct sk_buff *skb, struct nlmsghdr *nlh,
>> struct netlink_ext_ack *extack)
>> {
>> struct net *net = sock_net(skb->sk);
>> + struct nlattr *tb[NHA_MAX + 1];
>
> big tb[] array, but small rtm_nh_policy_del[] policy.
>
>> struct nl_info nlinfo = {
>> .nlh = nlh,
>> .nl_net = net,
>> @@ -3020,7 +3010,12 @@ static int rtm_del_nexthop(struct sk_buff *skb, struct nlmsghdr *nlh,
>> int err;
>> u32 id;
>>
>> - err = nh_valid_get_del_req(nlh, &id, extack);
>> + err = nlmsg_parse(nlh, sizeof(struct nhmsg), tb, NHA_MAX,
>
> But here you pass NHA_MAX...
>
existing code always used ARRAY_SIZE on the policy for both tb and
parse; the new del change should use it. Missed that in the review.
Powered by blists - more mailing lists