]> www.infradead.org Git - users/willy/pagecache.git/commit
ethtool: Fix access to uninitialized fields in set RXNFC command
authorGal Pressman <gal@nvidia.com>
Mon, 2 Dec 2024 16:48:05 +0000 (18:48 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Dec 2024 02:42:28 +0000 (18:42 -0800)
commit94071909477677fc2a1abf3fb281f203f66cf3ca
tree2dcc6b4f3934ef7cef62b330da3608330f70436a
parent3d501f562f63b290351169e3e9931ffe3d57b2ae
ethtool: Fix access to uninitialized fields in set RXNFC command

The check for non-zero ring with RSS is only relevant for
ETHTOOL_SRXCLSRLINS command, in other cases the check tries to access
memory which was not initialized by the userspace tool. Only perform the
check in case of ETHTOOL_SRXCLSRLINS.

Without this patch, filter deletion (for example) could statistically
result in a false error:
  # ethtool --config-ntuple eth3 delete 484
  rmgr: Cannot delete RX class rule: Invalid argument
  Cannot delete classification rule

Fixes: 9e43ad7a1ede ("net: ethtool: only allow set_rxnfc with rss + ring_cookie if driver opts in")
Link: https://lore.kernel.org/netdev/871a9ecf-1e14-40dd-bbd7-e90c92f89d47@nvidia.com/
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20241202164805.1637093-1-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/ioctl.c