Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>
Link: https://patch.msgid.link/1768212093-1594-1-git-send-email-gargaditya@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Aditya Garg and committed by
Jakub Kicinski
d2356495 fa572669

+3
+3
drivers/net/hyperv/netvsc_drv.c
··· 1750 1750 rxfh->hfunc != ETH_RSS_HASH_TOP) 1751 1751 return -EOPNOTSUPP; 1752 1752 1753 + if (!ndc->rx_table_sz) 1754 + return -EOPNOTSUPP; 1755 + 1753 1756 rndis_dev = ndev->extension; 1754 1757 if (rxfh->indir) { 1755 1758 for (i = 0; i < ndc->rx_table_sz; i++)