lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEb_5C9eDYVSkMHn@64799e4f873a>
Date: Mon, 9 Jun 2025 15:38:12 +0000
From: Subbaraya Sundeep <sbhatta@...vell.com>
To: Gal Pressman <gal@...dia.com>
CC: "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet
	<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni
	<pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>,
        <netdev@...r.kernel.org>, Andrew Lunn <andrew@...n.ch>,
        Simon Horman
	<horms@...nel.org>, Shuah Khan <shuah@...nel.org>,
        Joe Damato
	<jdamato@...tly.com>, <linux-kselftest@...r.kernel.org>,
        Tariq Toukan
	<tariqt@...dia.com>, Nimrod Oren <noren@...dia.com>
Subject: Re: [PATCH net v2 1/2] net: ethtool: Don't check if RSS context
 exists in case of context 0

On 2025-06-09 at 12:02:49, Gal Pressman (gal@...dia.com) wrote:
> Context 0 (default context) always exists, there is no need to check
> whether it exists or not when adding a flow steering rule.
> 
> The existing check fails when creating a flow steering rule for context
> 0 as it is not stored in the rss_ctx xarray.
> 
> For example:
> $ ethtool --config-ntuple eth2 flow-type tcp4 dst-ip 194.237.147.23 dst-port 19983 context 0 loc 618
> rmgr: Cannot insert RX class rule: Invalid argument
> Cannot insert classification rule
> 
> An example usecase for this could be:
> - A high-priority rule (loc 0) directing specific port traffic to
>   context 0.
> - A low-priority rule (loc 1) directing all other TCP traffic to context
>   1.
> 
> Fixes: de7f7582dff2 ("net: ethtool: prevent flow steering to RSS contexts which don't exist")
> Cc: Jakub Kicinski <kuba@...nel.org>
> Reviewed-by: Tariq Toukan <tariqt@...dia.com>
> Reviewed-by: Nimrod Oren <noren@...dia.com>
> Signed-off-by: Gal Pressman <gal@...dia.com>
> Reviewed-by: Joe Damato <jdamato@...tly.com>

Reviewed-by: Subbaraya Sundeep <sbhatta@...vell.com>

Thanks,
Sundeep

> ---
>  net/ethtool/ioctl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index 39ec920f5de7..71c828d0bf31 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -1083,7 +1083,8 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
>  		    ethtool_get_flow_spec_ring(info.fs.ring_cookie))
>  			return -EINVAL;
>  
> -		if (!xa_load(&dev->ethtool->rss_ctx, info.rss_context))
> +		if (info.rss_context &&
> +		    !xa_load(&dev->ethtool->rss_ctx, info.rss_context))
>  			return -EINVAL;
>  	}
>  
> -- 
> 2.40.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ