[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210104155708.972099071@linuxfoundation.org>
Date: Mon, 4 Jan 2021 16:56:56 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, LiLiang <liali@...hat.com>,
Ivan Vecera <ivecera@...hat.com>,
Michal Kubecek <mkubecek@...e.cz>,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH 5.10 03/63] ethtool: fix error paths in ethnl_set_channels()
From: Ivan Vecera <ivecera@...hat.com>
[ Upstream commit ef72cd3c5ce168829c6684ecb2cae047d3493690 ]
Fix two error paths in ethnl_set_channels() to avoid lock-up caused
but unreleased RTNL.
Fixes: e19c591eafad ("ethtool: set device channel counts with CHANNELS_SET request")
Reported-by: LiLiang <liali@...hat.com>
Signed-off-by: Ivan Vecera <ivecera@...hat.com>
Reviewed-by: Michal Kubecek <mkubecek@...e.cz>
Link: https://lore.kernel.org/r/20201215090810.801777-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
net/ethtool/channels.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/ethtool/channels.c
+++ b/net/ethtool/channels.c
@@ -194,8 +194,9 @@ int ethnl_set_channels(struct sk_buff *s
if (netif_is_rxfh_configured(dev) &&
!ethtool_get_max_rxfh_channel(dev, &max_rx_in_use) &&
(channels.combined_count + channels.rx_count) <= max_rx_in_use) {
+ ret = -EINVAL;
GENL_SET_ERR_MSG(info, "requested channel counts are too low for existing indirection table settings");
- return -EINVAL;
+ goto out_ops;
}
/* Disabling channels, query zero-copy AF_XDP sockets */
@@ -203,8 +204,9 @@ int ethnl_set_channels(struct sk_buff *s
min(channels.rx_count, channels.tx_count);
for (i = from_channel; i < old_total; i++)
if (xsk_get_pool_from_qid(dev, i)) {
+ ret = -EINVAL;
GENL_SET_ERR_MSG(info, "requested channel counts are too low for existing zerocopy AF_XDP sockets");
- return -EINVAL;
+ goto out_ops;
}
ret = dev->ethtool_ops->set_channels(dev, &channels);
Powered by blists - more mailing lists