Skip to content

Commit

Permalink
net: ethtool: reject unsupported RSS input xfrm values
Browse files Browse the repository at this point in the history
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: 13e5934 ("net: ethtool: add support for symmetric-xor RSS hash")
Suggested-by: Jakub Kicinski <[email protected]>
Signed-off-by: Ahmed Zaki <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
azaki1 authored and kuba-moo committed Jan 6, 2024
1 parent 2114e83 commit 948f97f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ethtool/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 948f97f

Please sign in to comment.