netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Eric Dumazet <edumazet@google.com>, Petr Machata <petrm@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, Ido Schimmel <idosch@nvidia.com>,
	Simon Horman <horms@kernel.org>,
	mlxsw@nvidia.com
Subject: Re: [PATCH net-next v4 1/7] net: nexthop: Adjust netlink policy parsing for a new attribute
Date: Sat, 9 Mar 2024 10:50:26 -0700	[thread overview]
Message-ID: <9def52e8-89ac-49eb-a2fa-5877d1d638de@kernel.org> (raw)
In-Reply-To: <CANn89i+UNcG0PJMW5X7gOMunF38ryMh=L1aeZUKH3kL4UdUqag@mail.gmail.com>

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.


  reply	other threads:[~2024-03-09 17:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 12:49 [PATCH net-next v4 0/7] Support for nexthop group statistics Petr Machata
2024-03-06 12:49 ` [PATCH net-next v4 1/7] net: nexthop: Adjust netlink policy parsing for a new attribute Petr Machata
2024-03-09 15:02   ` Eric Dumazet
2024-03-09 17:50     ` David Ahern [this message]
2024-03-06 12:49 ` [PATCH net-next v4 2/7] net: nexthop: Add NHA_OP_FLAGS Petr Machata
2024-03-06 17:22   ` Ido Schimmel
2024-03-06 12:49 ` [PATCH net-next v4 3/7] net: nexthop: Add nexthop group entry stats Petr Machata
2024-03-06 12:49 ` [PATCH net-next v4 4/7] net: nexthop: Expose nexthop group stats to user space Petr Machata
2024-03-06 12:49 ` [PATCH net-next v4 5/7] net: nexthop: Add hardware statistics notifications Petr Machata
2024-03-06 12:49 ` [PATCH net-next v4 6/7] net: nexthop: Add ability to enable / disable hardware statistics Petr Machata
2024-03-06 12:49 ` [PATCH net-next v4 7/7] net: nexthop: Expose nexthop group HW stats to user space Petr Machata
2024-03-08 10:40 ` [PATCH net-next v4 0/7] Support for nexthop group statistics patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9def52e8-89ac-49eb-a2fa-5877d1d638de@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).