diff mbox series

[net-next,1/1] net: ethtool: reject unsupported RSS input xfrm values

Message ID 20240104212653.394424-1-ahmed.zaki@intel.com (mailing list archive)
State Accepted
Commit 948f97f9d8d2aa3a742df028129d44130268f0e4
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/1] net: ethtool: reject unsupported RSS input xfrm values | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1115 this patch: 1115
netdev/cc_maintainers fail 1 blamed authors not CCed: wojciech.drewek@intel.com; 1 maintainers not CCed: wojciech.drewek@intel.com
netdev/build_clang success Errors and warnings before: 1141 this patch: 1141
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ahmed Zaki Jan. 4, 2024, 9:26 p.m. UTC
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@kernel.org>
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
---
 net/ethtool/ioctl.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 6, 2024, 3:40 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  4 Jan 2024 14:26:53 -0700 you wrote:
> 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@kernel.org>
> Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
> 
> [...]

Here is the summary with links:
  - [net-next,1/1] net: ethtool: reject unsupported RSS input xfrm values
    https://git.kernel.org/netdev/net-next/c/948f97f9d8d2

You are awesome, thank you!
diff mbox series

Patch

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;