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=1796355019; b=qQS5aC6NE6NikNszxDuLZJtFhWF6rctChQFtJwPAj3c01RB9FGzxvI7kVauPhf5IdRF9 F/p+79if1bpeO1FQ9Pz7kl3DEu21B4OYxCPqadJ7coeDZSNxZsdwp33NX/mLPI1cCBJyy g9Fn+xE6Cm6byOHwcsoHHnY7tYorIx35qce5BId0aESzb+TfXMjOeMlzTq6uinbQU3tt/ l5NSqL9BX+W5ilwRe+pCq9+Mj6A/e4uRyvzzd+4Ko6uLF9thHOD11InTRI2xkCPRwxrqN 97l1xMVbAaeXuCxM8FWuvBv60OuXNUGdE2Zi0mRv1lDpZ+GCtnylf1Em5UTozDUqRrg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796355019; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=3hFHlO8UT8u9OGe4GjJ9vHi1OUP3sc2WA/zBtEgvo04=; b=Xu17QctRz/FDg/dreMy0lVJdN9amBFtSjOugakcgz4AzWKPYWV5SjNkfcSmQvC8bwFVk MUJM4rsFZN/gA1+0OH4nr1wCX+7tQp7hSQ1hja3Vdq28Mb+ZsySPrPjNa1r0gWJdvnFQn KAP9TcDo2gWfQ5UX7L8CIAemBKybU9+MwcjhPxoo9GMEmcWPpUYhaNlI7jmvYkMd4wbxj J1Xzz8ANj9qK8hL8PKlnzJXWDAkSJO1x2pPAuxj9RIlKEWtIfAzajRCgfgQod+uhxpXLv 7HhbANA9/HqBH8gZUq4tY7YRfzYa8cGd1L9DnyC06l+qtKAqlnZcEIo9S0NrahGzb/g== 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=PZtfw7AV; 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 E16ED606A32C for ; Fri, 4 Dec 2026 03:30:18 +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=PZtfw7AV Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF4821F000C2; Fri, 4 Dec 2026 03:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796355018; bh=3hFHlO8UT8u9OGe4GjJ9vHi1OUP3sc2WA/zBtEgvo04=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PZtfw7AVwX42Dm/6V41eLpg0YeiuRuO9moe/tEGqEvWg4GkkNKS1SE/JPPaV1lEno 4c7RypGz3xQotipbTSK45Zr7FhaVtzDa80plzrSdNMOJlYkyIwoLuYEYRqJ+THtwvp ES8AD2XVsh82+xKn7kw80ID1dCb86Y+/MUS7ho0eXD2vLJGvzAZtelHVAGVDtiG3NM DvMfJ2acItrPbYtyrhnAoM0lU+59oQ4VkELJCSHYaDN3KmmRr+U1DOjCjJjJ9zWRfY gLI6dwLiNZ9diWWwryssI6OVq80AQ6ilVeYIAXhmuq5LfQHBxD491nvcEkTu3UXKOY 98T4KapqyF7UQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Filip Balluch , Aleksandr Loktionov , Alexander Nowlin , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12.y 1/2] i40e: fix freeing of TX rings on RX allocation failure Date: Thu, 3 Dec 2026 22:30:15 -0500 Message-ID: <20261204033007.2426837-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026120210-antennae-agnostic-530f@gregkh> References: <2026120210-antennae-agnostic-530f@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 9a96f67fb648f..66f46d045badb 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2247,7 +2247,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