]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: strset: allow ETHTOOL_A_STRSET_COUNTS_ONLY attr
authorJohannes Berg <johannes.berg@intel.com>
Wed, 7 Oct 2020 10:53:50 +0000 (12:53 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 Oct 2020 23:06:01 +0000 (16:06 -0700)
commitdb5435441c256dad14cb01d6afbdc67b77736ac8
tree4d3ce070c491a014b4f332ec8fb5c9d34c76d31b
parent08e3a83e64b9126ea5e8ab4457e7fb94485cc429
ethtool: strset: allow ETHTOOL_A_STRSET_COUNTS_ONLY attr

The ETHTOOL_A_STRSET_COUNTS_ONLY flag attribute was previously
not allowed to be used, but now due to the policy size reduction
we would access the tb[] array out of bounds since we tried to
check for the attribute despite it not being accepted.

Fix both issues by adding it correctly to the appropriate policy.

Fixes: 73f1d5bd8372 ("ethtool: trim policy tables")
Fixes: 1122a1558105 ("ethtool: provide string sets with STRSET_GET request")
Reported-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/netlink.h
net/ethtool/strset.c