public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com
Subject: Re: [PATCH net] net: ethtool: correct MAX attribute value for stats
Date: Thu, 8 Jun 2023 15:42:59 -0600	[thread overview]
Message-ID: <20230608214259.GA19475@u2004-local> (raw)
In-Reply-To: <20230608162344.1210365-1-kuba@kernel.org>

On Thu, Jun 08, 2023 at 09:23:44AM -0700, Jakub Kicinski wrote:
> When compiling YNL generated code compiler complains about
> array-initializer-out-of-bounds. Turns out the MAX value
> for STATS_GRP uses the value for STATS.
> 
> This may lead to random corruptions in user space (kernel
> itself doesn't use this value as it never parses stats).
> 
> Fixes: f09ea6fb1272 ("ethtool: add a new command for reading standard stats")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  include/uapi/linux/ethtool_netlink.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h
> index 1ebf8d455f07..73e2c10dc2cc 100644
> --- a/include/uapi/linux/ethtool_netlink.h
> +++ b/include/uapi/linux/ethtool_netlink.h
> @@ -783,7 +783,7 @@ enum {
>  
>  	/* add new constants above here */
>  	__ETHTOOL_A_STATS_GRP_CNT,
> -	ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1)
> +	ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_GRP_CNT - 1)
>  };
>  
>  enum {
> -- 
> 2.40.1
> 

Reviewed-by: David Ahern <dsahern@kernel.org>

  reply	other threads:[~2023-06-08 21:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 16:23 [PATCH net] net: ethtool: correct MAX attribute value for stats Jakub Kicinski
2023-06-08 21:42 ` David Ahern [this message]
2023-06-12  8:00 ` 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=20230608214259.GA19475@u2004-local \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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