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=1796381504; b=dUiJO+K0DsrG8iHMvwwjwWp3+CR70Q4zx/lFlUMAuycTfK9preSBJTJFT6kQ8RUl0Uz+ NTXvSrnc/hIfK+HuSROJyMRXClV85maD8GKZiwk5Ct97TArj8TdDPmTfQbA3ws3yrv3lk bp0EJlyHIf5Nu8bdIs4TirRTF5uU7Vq6Fdw5XPibA08E/ghQ62dwQLcVyAB+5JEWrEVWd DUF3Co9rcHtseHLqPtNjMrWQiTigEiHulxmyhrbHCfcP8Ct5Vzz9lDznVnHwV10Ae/HyQ AT8C2eMk3FnoCr8QjjPdww4wijd9X99lZR82AXOa5vwpKs8Az49xBriR5f+kd22KtIg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381504; 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=r12E9nU0Bw9EXE9TGzDdQ+2gPhxRTLIBnLbLJR1HptM=; b=VnxcWxcmPs4227BRq00ZEmbClTziATbgZrahwPC7SIXgxc3NkjDunaxTx/boJg2skjCF 2M08ciPw+23YCQaJ0YwBGkQ2ac2Z2pVB08u4A+a3eGcj1E302uM55csIgORdRtEfkSwBh rwz0pA00Dri2hdKmUKgCMua+poAu6MDUQmYwljFWMuDSZ1aTuI5keWO0gLHJ0yNPTSCrO FxA7S6LCN5fNScipWQfd3zusVQGWPDpx8nt8uOJcZbGIqJeR5fYEH0tNTb8gVFqf9iig7 8TvMEsfVCsQfCip9WAtSaOrqyhDtyGzC7RLcmG38d7fBsUhL0Rf91aEmMHhL/IVjdyQ== 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=YEps47lh; 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 C5C6A606A33B; Fri, 4 Dec 2026 10:51:44 +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=YEps47lh Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C4A71F000C2; Fri, 4 Dec 2026 10:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381504; bh=r12E9nU0Bw9EXE9TGzDdQ+2gPhxRTLIBnLbLJR1HptM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YEps47lhok3as7MaD2tTV8TMMDGAQYBdIuyXs+YilsZrs/r+zReJr141q+EslsTjF 04cTsWL5oha9MbQ0HFJ0ldT+99OuTGRiui0xpaSKXfe5/i1B8PBiLpfLKoTr686x9U BN5D+lUqx8PW/nNuWLA/xVCyftH+e3bs4QES88fg= 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 7.3 732/742] i40e: fix freeing of TX rings on RX allocation failure Date: Fri, 4 Dec 2026 19:09:56 +0900 Message-ID: <20261204100654.533096142@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 @@ -2249,7 +2249,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;