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=1796383053; b=OHaTU4oQq7kMI7SQ6RmulNf65OCZbEnaFzHGZVWAM+z1vcQqARhWqNuvdreaM0da2+Vy XRPIIORicp7ixD+ha/W63KkkXzpXwa3wH6gfvG02QTjvD5bzCYWQyiJMe9QPQJr8b5dNT uVP+HzP+nLFgldUcbHdWGwSzJK98gNH7M+gG3AUQa4fRegZscm875nP9T3A4BGUkJKJsH FESjLFvwwe4DVG0bC81CUzWMmgEGOsr+2YTMlE5HmGuzxyYdpAStAFU8IriMzyZWweDI/ eKa2Gp4D8XAWyqfQvmJPWKksyhXBzqW1QgelMG5m+OXD9Z32ODTvGdh8izBI3DO1ApA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383053; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=+0M0TaqId6LXWxy9RGBPA09EU/nNYpMnUXxrYISdQmA=; b=Ch5qUQ18BjoMxqu+HKoWoMe21tbJxjGRdNIVN2A1i/8GGQGQY95HxdX5d4fVkAYOdjmO yEOSdzde+IFXE+k5BWVun5EHl6jCdzS15SBAR3xbW58fbqVLwj/CvC4K/CDki51FwLkka 7envjiyD8dAId91BqUcPQAXrb1BIceb/3nHlkTQlcdP1ffFE5q6G7LRShl5/vPm3skylO 3vGAzwzZZ+l5LcDtzkvDbA/XgGnLiGEaiIxR2xzaj1s+JfBEqg8LJFjKymesktCYPz8Iv BH4bhGae9zVjpA636IVs3gw39jwkJVRjmiERZUb40AXZwkF22l6tu2sNdLf/llJRWEA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2fMaTZGy; 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 ACCFC606A684; Fri, 4 Dec 2026 11:17:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2fMaTZGy Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7AF51F00A05; Fri, 4 Dec 2026 11:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383053; bh=+0M0TaqId6LXWxy9RGBPA09EU/nNYpMnUXxrYISdQmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2fMaTZGyrHHGiy+9U+HtnzH9dk2G6jBHUoZOmeQVVTQQDmjiZ2J+H2vAFsTvnrvfe 5ocKVcH30855IiDzl6Qt1KRI6coAdX/SzXjPWDuyak3NOG9ogmwyEFCDVpipKZ8HgE f/z/vt/9iGEewMu0qssykZ6qtgXHyqHUn2ajJyqk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Filip Balluch , Aleksandr Loktionov , Alexander Nowlin , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 673/703] i40e: fix freeing of TX rings on RX allocation failure Date: Fri, 4 Dec 2026 19:09:32 +0900 Message-ID: <20261204100645.709243234@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore 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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2250,7 +2250,7 @@ free_tx: 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;