From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A2983290B0; Thu, 28 May 2026 19:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998195; cv=none; b=Jb81uxafgDqo8JbPGgqX6LQpw7j3j3rB+lO8pCTErt7CE/IxaSlZC+0rVJgMdDvaAtmM8HPcHHuajhRVnomxCcJzNaVWTgIY1TazB0T8uwXvm6PhxWA4wWgqlxUPgeSlU06FDsaoxkRGRXJyernDUfbI+Fz/MydCD9Nc6yu8J6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998195; c=relaxed/simple; bh=WUCHW3pBzoYJHljlrWag7NbzOw9NkjSWUrIjsAVSO2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fdTmDCWPhXOVcDnSTFMezXjJIwhGkC/Sfr1PDItKQdkPg75RBzjw+wFzfH87q/gzxEZF0Jbg3CK0DMr20oeBdZ4U7lYSgtq6zhi1CvirxET7LbFUi1byA4+dD+vlNu9ZwCZuujB7v82rI1Bpa06tu+d/AXyx3tDvHg1cvAjhXM4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Cp3eAY3l; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Cp3eAY3l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC8121F000E9; Thu, 28 May 2026 19:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779998194; bh=v/oBH4WADZ0m5bArHXhT8AErwRXQepsyZ8iw7P399G0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Cp3eAY3lbAXjn+toZlZwFHqN9mhIlEsEe/IClu2LWNfWhh3Nq3ZiF69B4Bwcg5u2W HtnewOyhOod+VxWm/nf6SF8bJEEiY0uQrQb54JblI330ur2D0RPOoWLJNAOdvk7Di5 hmGMB6pr8XrfyO592xi6ozGunXr7Y6m/hNv9hHy4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kohei Enju , Simon Horman , Faizal Rahim , Avigail Dahan , Tony Nguyen , Jakub Kicinski Subject: [PATCH 7.0 088/461] igc: fix potential skb leak in igc_fpe_xmit_smd_frame() Date: Thu, 28 May 2026 21:43:37 +0200 Message-ID: <20260528194649.475712649@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194646.819809818@linuxfoundation.org> References: <20260528194646.819809818@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kohei Enju commit e935c37b8a94bb256fada6395a5d05e1c0c6bdaf upstream. When igc_fpe_init_tx_descriptor() fails, no one takes care of an allocated skb, leaking it. [1] Use dev_kfree_skb_any() on failure. Tested on an I226 adapter with the following command, while injecting faults in igc_fpe_init_tx_descriptor() to trigger the error path. # ethtool --set-mm $DEV verify-enabled on tx-enabled on pmac-enabled on [1] unreferenced object 0xffff888113c6cdc0 (size 224): ... backtrace (crc be3d3fda): kmem_cache_alloc_node_noprof+0x3b1/0x410 __alloc_skb+0xde/0x830 igc_fpe_xmit_smd_frame.isra.0+0xad/0x1b0 igc_fpe_send_mpacket+0x37/0x90 ethtool_mmsv_verify_timer+0x15e/0x300 Cc: stable@vger.kernel.org Fixes: 5422570c0010 ("igc: add support for frame preemption verification") Signed-off-by: Kohei Enju Reviewed-by: Simon Horman Reviewed-by: Faizal Rahim Tested-by: Avigail Dahan Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260515182419.1597859-10-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/igc/igc_tsn.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/igc/igc_tsn.c +++ b/drivers/net/ethernet/intel/igc/igc_tsn.c @@ -109,10 +109,16 @@ static int igc_fpe_xmit_smd_frame(struct __netif_tx_lock(nq, cpu); err = igc_fpe_init_tx_descriptor(ring, skb, type); - igc_flush_tx_descriptors(ring); + if (err) + goto err_free_skb_any; + igc_flush_tx_descriptors(ring); __netif_tx_unlock(nq); + return 0; +err_free_skb_any: + __netif_tx_unlock(nq); + dev_kfree_skb_any(skb); return err; }