From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796355348; b=QtZMGtRgen5MDzlRi2Kj+6E8RV9hK1GLzArQmQeXduFnYUjvnKRLftmIjfTOpiPgss8d Hd2SvAr5esuB2sD5wbS1MWyf1xV9YG1Nk3G0t2SbMZCRYG0//yeG/NHYCZ66ZbuvNg+ys 50rwyiUVy/Jy/QvkxXWEm13C3Xym+es/mkZnbM+swjkcI22yWKvCBl9zUVH1CBpt/avJ2 bka3Qtu/ydWrAZWEtEmgdF4XRWsMCNGaQ2gKi646Q51C0IBiKQI0suc45EaWJR9CfxGcv xQUhMevoxDUhTA54ZMaF3HBHNyck5NErKADdaN8ypLssrGdoMybxzvlkIp/kH1wHdmQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796355348; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=CsI66t6BryQ5834o/n/p8zK4SKEnwWXGJm6E9WEz52s=; b=MtHQ4tx6VPoGPRUsTS2UXLOcBnoqLhP1abRPbyW+xbneYekiw2iA4jCpPhv3ch0BNzrp LeHUICvEqs0diUvN1dh3uF8BmmGUdyt/yUofFybVMMhRf9PRx8zZxbx1IvHwIwYK6aGDY l708tGtfg7iqONlb2aQ0UyfeyK/HXVVO5zkLjUaF+vkVIjIQXnFqB3Jt4G0E6ITKn2T0v fRIO2Iw9f6ve7r3eSjlEsShFuHxs7Nd0wAcYK6QQ2OhtgyBSqgMaI7F7HtJ/G3R3rW0V3 CEjUALQbunDAg+b9qEj9Aa31kObr/RhvLWh08rWcJw4046HJESIq0VqTC7kgQ06Anmg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QEjyS7MW; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70201606A333 for ; Fri, 4 Dec 2026 03:35:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QEjyS7MW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75A471F000C2; Fri, 4 Dec 2026 03:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796355348; bh=CsI66t6BryQ5834o/n/p8zK4SKEnwWXGJm6E9WEz52s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QEjyS7MW5Z0pbWyy2KGdTwNx0SxrGYvnUJEtdPpw+yYKVR0Hyvj0tjjmMhFQZC0Mt WMV4uqM/nu+WWzvSNUFAugceRi9OTTWE0x1PN9KWg/UiXVrq5pKl+sE/Oj7Xc5aOOx lWe39M77YlErdMWI3glhl50PNiGCRUiWbHBICSYzo4/KAPwPwAkNnKs9GXnXXxXckC goUmeGE9mZbyYQDD1KZEA9lfp94KrADXZkhppAHZM8yIozjV6dDlrSxar2YvME0ztn 3RBr5DJ4SDUDqAURLQg3I4jpi05WJzVHOifoH0AdJNnUIqJJpGmFFSSlRv+3TFACdr S8HUR9HpktBYA== From: Sasha Levin To: stable@vger.kernel.org Cc: Filip Balluch , Aleksandr Loktionov , Alexander Nowlin , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6.y 1/2] i40e: fix freeing of TX rings on RX allocation failure Date: Thu, 3 Dec 2026 22:35:45 -0500 Message-ID: <20261204033538.2445340-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026120211-enunciate-peso-2d7f@gregkh> References: <2026120211-enunciate-peso-2d7f@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Filip Balluch [ Upstream commit 4957f668681a2e1e2dab4731d75a2c53c6017319 ] When ethtool -G is used to change ring buffer sizes while the interface is up, i40e_set_ringparam() allocates temporary TX and RX rings. If the RX ring allocation fails, the error path at the free_tx label incorrectly calls i40e_free_tx_resources(vsi->tx_rings[i]), freeing the live TX rings instead of the temporary tx_rings[i]. Since the interface is still up, the next TX completion interrupt causes i40e_clean_tx_irq() to dereference the freed ring descriptors, resulting in a NULL pointer dereference in IRQ context and a kernel panic. This can be reproduced on systems with Intel X710 NICs under memory pressure, where the second port's DMA allocation fails after the first port succeeds. Fix by freeing the temporary tx_rings[i] in the error path instead of the live vsi->tx_rings[i]. Fixes: 74608d17fe29 ("i40e: add support for XDP_TX action") Signed-off-by: Filip Balluch Reviewed-by: Aleksandr Loktionov Tested-by: Alexander Nowlin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-3-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Stable-dep-of: e3916fa03f4d ("i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam") Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 077d5daaedcca..b1f8ee07ee2f3 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2264,7 +2264,7 @@ static int i40e_set_ringparam(struct net_device *netdev, if (tx_rings) { for (i = 0; i < tx_alloc_queue_pairs; i++) { if (i40e_active_tx_ring_index(vsi, i)) - i40e_free_tx_resources(vsi->tx_rings[i]); + i40e_free_tx_resources(&tx_rings[i]); } kfree(tx_rings); tx_rings = NULL; -- 2.53.0