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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709172508.5df4e5c9@kernel.org>
Date: Wed, 9 Jul 2025 17:25:08 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Gal Pressman <gal@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, 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>, Dragos Tatulea
 <dtatulea@...dia.com>
Subject: Re: [PATCH net-next] ethtool: Fix set RXFH for drivers without RXFH
 fields support

On Wed, 9 Jul 2025 18:32:51 +0300 Gal Pressman wrote:
> Some drivers (e.g., mlx4_en) support ->set_rxfh() functionality (such as
> setting hash function), but not setting the RXFH fields.
> 
> The requirement of ->get_rxfh_fields() in ethtool_set_rxfh() is there to
> verify that we have no conflict with the RSS fields options, if it
> doesn't exist then there is no point in doing the check.
> Soften the check in ethtool_set_rxfh() so it doesn't fail when
> ->get_rxfh_fields() doesn't exist.  
> 
> This fixes the following error:
> $ ethtool --set-rxfh-indir eth2 hfunc xor
> Cannot set RX flow hash configuration: Operation not supported

Ah, thanks for the fix!

In this case I wonder if we wouldn't be better off returning early 
in ethtool_check_flow_types() if input_xfrm is 0 or NO_CHANGE.
Most drivers will have get_rxfh_fields - still there's no point
in doing the check if they have empty ops->supported_input_xfrm

We could add a:

	if (WARN_ON(ops->supported_input_xfrm && !ops->get_rxfh_fields))
		return -EINVAL;

into ethtool_check_ops() and we'd be both safe and slightly faster.

WDYT?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ