Skip to content

Commit 5c8d5f1

Browse files
committed
net: ethtool: correct MAX attribute value for stats
JIRA: https://issues.redhat.com/browse/RHEL-46358 Upstream Status: net.git commit 52f7960 commit 52f7960 Author: Jakub Kicinski <kuba@kernel.org> Date: Thu Jun 8 09:23:44 2023 -0700 net: ethtool: correct MAX attribute value for stats 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: f09ea6f ("ethtool: add a new command for reading standard stats") Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
1 parent 024cb55 commit 5c8d5f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/uapi/linux/ethtool_netlink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ enum {
783783

784784
/* add new constants above here */
785785
__ETHTOOL_A_STATS_GRP_CNT,
786-
ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1)
786+
ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_GRP_CNT - 1)
787787
};
788788

789789
enum {

0 commit comments

Comments
 (0)