public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table
@ 2026-01-12 10:01 Aditya Garg
  2026-01-12 13:09 ` Dipayaan Roy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Aditya Garg @ 2026-01-12 10:01 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, longli, andrew+netdev, davem,
	edumazet, kuba, pabeni, stephen, linux-hyperv, netdev,
	linux-kernel, dipayanroy, ssengar, shradhagupta, ernis,
	gargaditya, gargaditya

RSS configuration requires a valid RX indirection table. When the device
reports a single receive queue, rndis_filter_device_add() does not
allocate an indirection table, accepting RSS hash key updates in this
state leads to a hang.

Fix this by gating netvsc_set_rxfh() on ndc->rx_table_sz and return
-EOPNOTSUPP when the table is absent. This aligns set_rxfh with the device
capabilities and prevents incorrect behavior.

Fixes: 962f3fee83a4 ("netvsc: add ethtool ops to get/set RSS key")
Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com>
Reviewed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 3d47d749ef9f..cbd52cb79268 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1750,6 +1750,9 @@ static int netvsc_set_rxfh(struct net_device *dev,
 	    rxfh->hfunc != ETH_RSS_HASH_TOP)
 		return -EOPNOTSUPP;
 
+	if (!ndc->rx_table_sz)
+		return -EOPNOTSUPP;
+
 	rndis_dev = ndev->extension;
 	if (rxfh->indir) {
 		for (i = 0; i < ndc->rx_table_sz; i++)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table
  2026-01-12 10:01 [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table Aditya Garg
@ 2026-01-12 13:09 ` Dipayaan Roy
  2026-01-12 15:34 ` Haiyang Zhang
  2026-01-14  3:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Dipayaan Roy @ 2026-01-12 13:09 UTC (permalink / raw)
  To: Aditya Garg
  Cc: kys, haiyangz, wei.liu, decui, longli, andrew+netdev, davem,
	edumazet, kuba, pabeni, stephen, linux-hyperv, netdev,
	linux-kernel, ssengar, shradhagupta, ernis, gargaditya

On Mon, Jan 12, 2026 at 02:01:33AM -0800, Aditya Garg wrote:
> RSS configuration requires a valid RX indirection table. When the device
> reports a single receive queue, rndis_filter_device_add() does not
> allocate an indirection table, accepting RSS hash key updates in this
> state leads to a hang.
> 
> Fix this by gating netvsc_set_rxfh() on ndc->rx_table_sz and return
> -EOPNOTSUPP when the table is absent. This aligns set_rxfh with the device
> capabilities and prevents incorrect behavior.
> 
> Fixes: 962f3fee83a4 ("netvsc: add ethtool ops to get/set RSS key")
> Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com>
> Reviewed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
> ---
>  drivers/net/hyperv/netvsc_drv.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index 3d47d749ef9f..cbd52cb79268 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -1750,6 +1750,9 @@ static int netvsc_set_rxfh(struct net_device *dev,
>  	    rxfh->hfunc != ETH_RSS_HASH_TOP)
>  		return -EOPNOTSUPP;
>  
> +	if (!ndc->rx_table_sz)
> +		return -EOPNOTSUPP;
> +
>  	rndis_dev = ndev->extension;
>  	if (rxfh->indir) {
>  		for (i = 0; i < ndc->rx_table_sz; i++)
> -- 
> 2.43.0
>

LGTM.

Reviewed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table
  2026-01-12 10:01 [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table Aditya Garg
  2026-01-12 13:09 ` Dipayaan Roy
@ 2026-01-12 15:34 ` Haiyang Zhang
  2026-01-14  3:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Haiyang Zhang @ 2026-01-12 15:34 UTC (permalink / raw)
  To: Aditya Garg, KY Srinivasan, wei.liu@kernel.org, Dexuan Cui,
	Long Li, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	stephen@networkplumber.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	dipayanroy@linux.microsoft.com, ssengar@linux.microsoft.com,
	shradhagupta@linux.microsoft.com, ernis@linux.microsoft.com,
	Aditya Garg



> -----Original Message-----
> From: Aditya Garg <gargaditya@linux.microsoft.com>
> Sent: Monday, January 12, 2026 5:02 AM
> To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; wei.liu@kernel.org; Dexuan Cui
> <DECUI@microsoft.com>; Long Li <longli@microsoft.com>;
> andrew+netdev@lunn.ch; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com; stephen@networkplumber.org; linux-
> hyperv@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; dipayanroy@linux.microsoft.com;
> ssengar@linux.microsoft.com; shradhagupta@linux.microsoft.com;
> ernis@linux.microsoft.com; Aditya Garg <gargaditya@microsoft.com>;
> gargaditya@linux.microsoft.com
> Subject: [PATCH net-next] net: hv_netvsc: reject RSS hash key programming
> without RX indirection table
> 
> RSS configuration requires a valid RX indirection table. When the device
> reports a single receive queue, rndis_filter_device_add() does not
> allocate an indirection table, accepting RSS hash key updates in this
> state leads to a hang.
> 
> Fix this by gating netvsc_set_rxfh() on ndc->rx_table_sz and return
> -EOPNOTSUPP when the table is absent. This aligns set_rxfh with the device
> capabilities and prevents incorrect behavior.
> 
> Fixes: 962f3fee83a4 ("netvsc: add ethtool ops to get/set RSS key")
> Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com>
> Reviewed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>

Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table
  2026-01-12 10:01 [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table Aditya Garg
  2026-01-12 13:09 ` Dipayaan Roy
  2026-01-12 15:34 ` Haiyang Zhang
@ 2026-01-14  3:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-14  3:10 UTC (permalink / raw)
  To: Aditya Garg
  Cc: kys, haiyangz, wei.liu, decui, longli, andrew+netdev, davem,
	edumazet, kuba, pabeni, stephen, linux-hyperv, netdev,
	linux-kernel, dipayanroy, ssengar, shradhagupta, ernis,
	gargaditya

Hello:

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

On Mon, 12 Jan 2026 02:01:33 -0800 you wrote:
> RSS configuration requires a valid RX indirection table. When the device
> reports a single receive queue, rndis_filter_device_add() does not
> allocate an indirection table, accepting RSS hash key updates in this
> state leads to a hang.
> 
> Fix this by gating netvsc_set_rxfh() on ndc->rx_table_sz and return
> -EOPNOTSUPP when the table is absent. This aligns set_rxfh with the device
> capabilities and prevents incorrect behavior.
> 
> [...]

Here is the summary with links:
  - [net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table
    https://git.kernel.org/netdev/net/c/d23564955811

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-14  3:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12 10:01 [PATCH net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table Aditya Garg
2026-01-12 13:09 ` Dipayaan Roy
2026-01-12 15:34 ` Haiyang Zhang
2026-01-14  3:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox