]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: ethtool: correct MAX attribute value for stats
authorJakub Kicinski <kuba@kernel.org>
Thu, 8 Jun 2023 16:23:44 +0000 (09:23 -0700)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:11 +0000 (17:19 +0200)
BugLink: https://bugs.launchpad.net/bugs/2033931
[ Upstream commit 52f79609c0c5b25fddb88e85f25ce08aa7e3fb42 ]

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>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/uapi/linux/ethtool_netlink.h

index 5799a9db034eab8bc7f0dffc893b752dbce7e3ed..4d3de912d1482c9fca8501950d9a09767462314c 100644 (file)
@@ -764,7 +764,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 {