All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@nvidia.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Vivien Didelot <vivien.didelot@gmail.com>
Subject: Re: [PATCH net 2/2] net: bridge: fix under estimation in br_get_linkxstats_size()
Date: Tue, 5 Oct 2021 12:04:11 +0300	[thread overview]
Message-ID: <1f9eac11-cf42-68a4-632d-ce39677d9aac@nvidia.com> (raw)
In-Reply-To: <20211005010508.2194560-3-eric.dumazet@gmail.com>

On 05/10/2021 04:05, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Commit de1799667b00 ("net: bridge: add STP xstats")
> added an additional nla_reserve_64bit() in br_fill_linkxstats(),
> but forgot to update br_get_linkxstats_size() accordingly.
> 
> This can trigger the following in rtnl_stats_get()
> 
> 	WARN_ON(err == -EMSGSIZE);
> 
> Fixes: de1799667b00 ("net: bridge: add STP xstats")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Vivien Didelot <vivien.didelot@gmail.com>
> Cc: Nikolay Aleksandrov <nikolay@nvidia.com>
> ---
>  net/bridge/br_netlink.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index 29b8f6373fb925d48ce876dcda7fccc10539240a..5c6c4305ed235891b2ed5c5a17eb8382f2aec1a0 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -1667,6 +1667,7 @@ static size_t br_get_linkxstats_size(const struct net_device *dev, int attr)
>  
>  	return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) +
>  	       nla_total_size_64bit(sizeof(struct br_mcast_stats)) +
> +	       (p ? nla_total_size_64bit(sizeof(p->stp_xstats)) : 0) +
>  	       nla_total_size(0);
>  }
>  
> 

Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>

  reply	other threads:[~2021-10-05  9:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  1:05 [PATCH net 0/2] net: bridge: br_get_linkxstats_size() fixes Eric Dumazet
2021-10-05  1:05 ` [PATCH net 1/2] net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size() Eric Dumazet
2021-10-05  9:03   ` Nikolay Aleksandrov
2021-10-05  1:05 ` [PATCH net 2/2] net: bridge: fix under estimation " Eric Dumazet
2021-10-05  9:04   ` Nikolay Aleksandrov [this message]
2021-10-05 11:50 ` [PATCH net 0/2] net: bridge: br_get_linkxstats_size() fixes 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=1f9eac11-cf42-68a4-632d-ce39677d9aac@nvidia.com \
    --to=nikolay@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.