]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ethtool: Fix set RXNFC command with symmetric RSS hash
authorGal Pressman <gal@nvidia.com>
Sun, 26 Jan 2025 19:18:45 +0000 (21:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Feb 2025 09:02:13 +0000 (10:02 +0100)
commit97f2c87e5141182fa4579a84dc36e11b008e9bbb
treee3f440c5994b469bc3e3faafcddca8540a99af19
parentfc4866643d1c4328c53a5700f9b2155f60cad4c1
ethtool: Fix set RXNFC command with symmetric RSS hash

[ Upstream commit 4f5a52adeb1ad675ca33f1e1eacd9c0bbaf393d4 ]

The sanity check that both source and destination are set when symmetric
RSS hash is requested is only relevant for ETHTOOL_SRXFH (rx-flow-hash),
it should not be performed on any other commands (e.g.
ETHTOOL_SRXCLSRLINS/ETHTOOL_SRXCLSRLDEL).

This resolves accessing uninitialized 'info.data' field, and fixes false
errors in rule insertion:
  # ethtool --config-ntuple eth2 flow-type ip4 dst-ip 255.255.255.255 action -1 loc 0
  rmgr: Cannot insert RX class rule: Invalid argument
  Cannot insert classification rule

Fixes: 13e59344fb9d ("net: ethtool: add support for symmetric-xor RSS hash")
Cc: Ahmed Zaki <ahmed.zaki@intel.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Reviewed-by: Ahmed Zaki <ahmed.zaki@intel.com>
Link: https://patch.msgid.link/20250126191845.316589-1-gal@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ethtool/ioctl.c