From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAA392E9EC3; Tue, 15 Jul 2025 13:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752587923; cv=none; b=QDVDHNSBcnmohJNYMykTQQCBHH2clkOusDZLfUptnMYMNL+VUJM9qCFUZKU63PvM+sNOPATsQS4ybrzmlVNZ0L4O9uXF4I9xNA265y8FqMw3XhanIxlDq+AoSnWcTKpTu5uhbIU1E5COajm24iK2iEcdEtWu5wFdfrGeB2zysLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752587923; c=relaxed/simple; bh=AXpk9koZ21v1bX4sMSlLjPgb4jIbS/+JsCHw5YFu/WI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d5cyMkWpFR4S8XxzuM/S/IR5EF8Hcg7KUEvQF8vHgw+rXI6UifueEu5NJIYat+5mLEpRB7uQNsS3ekCJckd/8X2y7smsFGt6YvZ+yHS/ohR5EU+V8bE4mOEnBdKpr9Rjg2iXXaXw0zD7pWG0JMrdxoK65OCR3Cd8hWN7Oltt3S4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=B6f/t6WR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="B6f/t6WR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EA78C4CEE3; Tue, 15 Jul 2025 13:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752587923; bh=AXpk9koZ21v1bX4sMSlLjPgb4jIbS/+JsCHw5YFu/WI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6f/t6WRBnNMFU4MAJp7y90Y5qjNrdfRbcCnv/KlKAdbQqBf6217Fs52znBGCKnWP My0mWXfkG3O3i/UmEosZARBk1/9SpY3bnuvKS9UzYX4ge1A8KNSqd7rfesK3n20LIk mV3cWiHUqc0vHCQnPBoQ9oeY0zDnykcnQo8Iq+ls= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alok Tiwari , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 192/208] net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam() Date: Tue, 15 Jul 2025 15:15:01 +0200 Message-ID: <20250715130818.637288368@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250715130810.830580412@linuxfoundation.org> References: <20250715130810.830580412@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alok Tiwari [ Upstream commit e81750b4e3826fedce7362dad839cb40384d60ae ] The function ll_temac_ethtools_set_ringparam() incorrectly checked rx_pending twice, once correctly for RX and once mistakenly in place of tx_pending. This caused tx_pending to be left unchecked against TX_BD_NUM_MAX. As a result, invalid TX ring sizes may have been accepted or valid ones wrongly rejected based on the RX limit, leading to potential misconfiguration or unexpected results. This patch corrects the condition to properly validate tx_pending. Fixes: f7b261bfc35e ("net: ll_temac: Make RX/TX ring sizes configurable") Signed-off-by: Alok Tiwari Link: https://patch.msgid.link/20250710180621.2383000-1-alok.a.tiwari@oracle.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index e50b59efe188b..5ace1a4905d7e 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -1299,7 +1299,7 @@ static int ll_temac_ethtools_set_ringparam(struct net_device *ndev, if (ering->rx_pending > RX_BD_NUM_MAX || ering->rx_mini_pending || ering->rx_jumbo_pending || - ering->rx_pending > TX_BD_NUM_MAX) + ering->tx_pending > TX_BD_NUM_MAX) return -EINVAL; if (netif_running(ndev)) -- 2.39.5