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=1796354175; b=ubXPx/V+w2FlHV0yXjx+lrfmT6E+a25sovtlmNgepBFFlwuhqvNo/cyX3O1kCf+C7Kv/ Fe1FAohyVTJPykxjQYmxRNVPKBxv4QxGox4SDxa8atcBBP5u5nwp0P9FbkSFcWNkavVjn 45oTnnGHj0fKqI7UgulUqyIF16oJN3NsL9zF7tMMaF32RUiMTkgJE+aesFgIe4M4Cml0k glg8AIFEz1oy3oTwMJNwX9VsUA+sY4EVyUImgAHZWyLL8rEteW6X8jw1tG4L1pAaiAEvH MDVPZ+Z5oFjWLP8VgPYG396qyUSKYLzQQRpoZRo2kpf/zCa0F2pDNW6bB5bA/+jy7Mg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796354175; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=3TPFfHhXr9g7/LRZD4Cq28AFtThD2iiD3zAivNoqjOQ=; b=xP0r5EYVCgwMIV9Xavyq5y9L235F2Bs0lxMzDgNQErfL/Rsa3C4CI6i8X4ja/11GFbfp 3RrQOo8xN1q8urihqTtUKXk0z6NYJIzB3Q/y+I8v7+9T1BwcILnZZtNuTnDrSD6qC9sTv /MIBpy6UvxRhisX1Wy3PBdHn7eaaR060echFzInWb0Y7JMkZ2mXMm/JMcalUZe3MNd30P PiCM11gYHOErKkCEJcb6cKkvb0HMy1Cx8gZdKxth2xqdVK6DVCpskEkILm1q4R69C7I4o Vx/DM7Ca/uMYqcRyHiILmpLe5C8i2aCZme44VntUGzJwo9HpepHqogK8oefb42/zBYQ== 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=m5DA2GJw; 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 B4B5F606A322 for ; Fri, 4 Dec 2026 03:16:15 +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=m5DA2GJw Received: by smtp.kernel.org (Postfix) with ESMTPSA id 686261F000C2; Fri, 4 Dec 2026 03:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796354175; bh=3TPFfHhXr9g7/LRZD4Cq28AFtThD2iiD3zAivNoqjOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=m5DA2GJwDni0BHXb5GsdYiOK1O8xAQkgSlcSbE8KVRBo1Ogy0kqIzfdoao9QXMN5R QvTIgvJZmlLBXDe29aS51pmP9ssBPUeA8Ucmu5EDeE5bgwT9dVaMc22k51JbtAVz4s Rw4icYhIGp4ezknED9TNhXvBPUmQ2gBIL7Phm46AjXmzb54K/+3a1EP8RW82QmF6N4 K89MGt+eA8E6TgChFFgSxTZIqAbuj2fzyk91fCpXkxasAH0KTghmQqg3gPhJIuhf+V CQ7vZdxJvYrMa6chw/2giD6eumQ6x7OOF2obJMON5BB6r9L43Vbm+3HB4lnNpUVvch pP4VCCWNwu7ow== From: Sasha Levin To: stable@vger.kernel.org Cc: Filip Balluch , Aleksandr Loktionov , Alexander Nowlin , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.3.y 1/2] i40e: fix freeing of TX rings on RX allocation failure Date: Thu, 3 Dec 2026 22:16:12 -0500 Message-ID: <20261204031559.2315177-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026120208-tree-unworn-aafb@gregkh> References: <2026120208-tree-unworn-aafb@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 3da9ec49cc745..6d2b076049f7e 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