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 57E3027584E; Tue, 15 Jul 2025 13:21:28 +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=1752585688; cv=none; b=JoMEtu+/qiMxg4iiui/FimSOr4RE5MXf28+jriekAC2nWKq5ugPH8ZZaILyPy4V5+9afnwoHJV95X3Y5+juT/pHekorotC3xB8n/11Uok2L5lQNyk+zc5o9juT2wRaelBkBHkj+KtNKd6q5ko3Pv5RhL3JnHei//edYbVnW3dPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752585688; c=relaxed/simple; bh=Mp3Fld91axa9a8CJwVTgA6j4S9PQwPwZ4oPYR45d/rE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=inQMja0kJ7d7gUhNb4mqBOCvHGT526ntgDsREOOuHR/VJoUADNYzMDlDiP3UB1QN0NWLxcr+yFFo8tTXaAFgvi8CgxDsl26BxB0rMAVONrpk7/VcFU7SkaqV6cUgO4dyaHdzcyWO351GLTaV5/r66y7YQQUxpliMGxXpVE7LiMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aiWKXq/O; 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="aiWKXq/O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFCA6C4CEE3; Tue, 15 Jul 2025 13:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752585688; bh=Mp3Fld91axa9a8CJwVTgA6j4S9PQwPwZ4oPYR45d/rE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aiWKXq/O9UqdJ8/M22gV61WbnNcWMnSksEbtXZTPgpkA0EE1zFqQkHjYoJKlk078J b5dMaW/jRfOcwxq6wdGQmOyfdoqvxOxS/TpaXRIeD9tPdUgOqo+Z1T92wAuCbBReGP 3ZGeN1QDACy7Z9JAxR/wPsF7aOUym0jxl0IrTNtQ= 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 6.12 135/163] net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam() Date: Tue, 15 Jul 2025 15:13:23 +0200 Message-ID: <20250715130814.255195040@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250715130808.777350091@linuxfoundation.org> References: <20250715130808.777350091@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 1072e2210aed3..6b93418224e7e 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -1309,7 +1309,7 @@ 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