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=1796355702; b=Eqq/0Ssjfn15Jq3j4L9LWLaECtA15jG3aZQt0brsB+yFEE10iCGggmyZ5CD21vmXisHU 0pnIbEGGY0mLD82PIG/sXaGqiyX+2tLNHI28HRLTIFRUUaDYhn8gynCG6H/aY+k4CCDmN 59bWaz12gB14GK/q9eZjsrLNCna6ZpgI93+HvG5KcyLuw/R6Yf7QnGAo3/y3/8WVbtrw7 RDcaUufhm+icVTMy+qzkAfJr2emYiGo4rJNG2DINRQoN58/1xmduMO9ImclkyJYgCpKeb mBC3Qnr/gGGL61BSqGxq2g0317psJqEjzVtkTsrEcqqgEsWoz6sk2blDmMi4JU2t5fg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796355702; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=/BcyY5H6E4XSJfARkBlyg+G/qLsXj65+oext6/HQhxc=; b=YetffCExuSduy/wHPg+sTXTIX+JQilEL7SJnnGkeE1YdkK8rwGcOPXWv+sC0/3BmkChZ enrZDBdaJfzuN3zgSa88hE50mDKJ6TAz0JJuQ4NratuPdSZ3zMbQlj4wWJj2mUIKNIZq7 6juYMO7Ei80QitOY9576UBTA311S6Dahmy9lFKMAFQkZ6IujrXe8nTpCYNLkh7JZtOFnh DxRZU28sbwYCf06hik5m4/csRVfoGj/zbZJjnWvXzMVjKe5FyGBzJjoRcvZzmQbxkZwbG gikbWXqkHKd6hKLb74Gewvs35ercyf2yoI433NdQ9gwV6RSbSVVkVNZI+VmXT03s4yA== 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=m2YViej1; 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 CC67E606A322 for ; Fri, 4 Dec 2026 03:41:42 +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=m2YViej1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AC011F000CE; Fri, 4 Dec 2026 03:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796355702; bh=/BcyY5H6E4XSJfARkBlyg+G/qLsXj65+oext6/HQhxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=m2YViej19H9UXbaZ/JG0gDpP04bE0KEH1cvh6GyuuNc2MCJ/efv6+f41N8bWaE4uV WFEH6o57Icob4QObWrDwGqo/N22VEPQHmLE4kfl9YaKSCOzeyrk5YF8t2QcBnSUlLW X3VDdjrR4PtrU/eCwwLlEnxGUYl5/kj75ZiFwa7P/Toy6PtFBO93quNpA/5AUXqsS6 HECyLE1xmdS8hChZP/325z081jlre+0kCESRZxwIdr/aeZvJou6Uyw8ryOJ5wvwLb4 gEPzsrvJEr1CMOw7LeefxZK6hLjmyDyCN9B6EUj8+TTlSJlajCM9m7CR/15IFVMtXr M7E8e8UtXEixA== From: Sasha Levin To: stable@vger.kernel.org Cc: Filip Balluch , Aleksandr Loktionov , Alexander Nowlin , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1.y 1/2] i40e: fix freeing of TX rings on RX allocation failure Date: Thu, 3 Dec 2026 22:41:39 -0500 Message-ID: <20261204034131.2467494-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026120212-passivism-scrambled-ac6d@gregkh> References: <2026120212-passivism-scrambled-ac6d@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 1aed31bc2e8ae..e83601d04dd76 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2249,7 +2249,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