summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-01-31 17:30:38 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 09:58:19 +0100
commit333f1282241c3c123bc3ab456912240a53a0102d (patch)
treefdd45ee165bfe3165aa487209b0524e4791f8c39
parent5ae72abbf91eb172ce3a838a4dc34be3c9707296 (diff)
ethtool: ntuple: fix rss + ring_cookie check
commit 2b91cc1214b165c25ac9b0885db89a0d3224028a upstream. The info.flow_type is for RXFH commands, ntuple flow_type is inside the flow spec. The check currently does nothing, as info.flow_type is 0 (or even uninitialized by user space) for ETHTOOL_SRXCLSRLINS. Fixes: 9e43ad7a1ede ("net: ethtool: only allow set_rxnfc with rss + ring_cookie if driver opts in") Reviewed-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Joe Damato <jdamato@fastly.com> Link: https://patch.msgid.link/20250201013040.725123-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ethtool/ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index ff988e5faa4f..8b9692c35e70 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -993,7 +993,7 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
return rc;
/* Nonzero ring with RSS only makes sense if NIC adds them together */
- if (cmd == ETHTOOL_SRXCLSRLINS && info.flow_type & FLOW_RSS &&
+ if (cmd == ETHTOOL_SRXCLSRLINS && info.fs.flow_type & FLOW_RSS &&
!ops->cap_rss_rxnfc_adds &&
ethtool_get_flow_spec_ring(info.fs.ring_cookie))
return -EINVAL;