[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240104212653.394424-1-ahmed.zaki@intel.com>
Date: Thu, 4 Jan 2024 14:26:53 -0700
From: Ahmed Zaki <ahmed.zaki@...el.com>
To: netdev@...r.kernel.org
Cc: corbet@....net,
jesse.brandeburg@...el.com,
anthony.l.nguyen@...el.com,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
vladimir.oltean@....com,
andrew@...n.ch,
horms@...nel.org,
mkubecek@...e.cz,
Ahmed Zaki <ahmed.zaki@...el.com>
Subject: [PATCH net-next 1/1] net: ethtool: reject unsupported RSS input xfrm values
RXFH input_xfrm currently has three supported values: 0 (clear all),
symmetric_xor and NO_CHANGE.
Reject any other value sent from user-space.
Fixes: 13e59344fb9d ("net: ethtool: add support for symmetric-xor RSS hash")
Suggested-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Ahmed Zaki <ahmed.zaki@...el.com>
---
net/ethtool/ioctl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 4bc9a2a07bbb..7519b0818b91 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1302,6 +1302,9 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
if (rxfh.rss_context && !ops->cap_rss_ctx_supported)
return -EOPNOTSUPP;
/* Check input data transformation capabilities */
+ if (rxfh.input_xfrm && rxfh.input_xfrm != RXH_XFRM_SYM_XOR &&
+ rxfh.input_xfrm != RXH_XFRM_NO_CHANGE)
+ return -EINVAL;
if ((rxfh.input_xfrm & RXH_XFRM_SYM_XOR) &&
!ops->cap_rss_sym_xor_supported)
return -EOPNOTSUPP;
--
2.34.1
Powered by blists - more mailing lists