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 36A142459D1; Thu, 28 May 2026 20:18:43 +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=1779999524; cv=none; b=h2NFyV6tY0l4lXt9byuxLEmtbt9m8RN5SGBDTlpjukT6QI2t9lnrPV1NSXx1qp3XnCNa2ey5K+DbR4hsp0rc3BUqT6NlaAPlweULVMd21UVSI8BEsN7ABs3T32ynIbIlp8VdVPyosbSx8GQ5ckPU2vMEWDU42x4v3yg740eSwww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999524; c=relaxed/simple; bh=/WbGnV1EHNd/EW9TVnVmTKAQk1RpEwErMfV7XQ/beiE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KfJDkNKlh9Bg5+4SC1VXZGBYby5ZBV8p7MaV+H9AyGM4IVhIh54dG9k30tb+YG/Q0txrbDBU6twg01MUyxPA3NQmUSmaGZiTg2bm58lEb49jxQYJ3IFP0MMT5FBfcEfGUS4naZA8EZkkyGEBjqzanExWoNDfEdiqSg1SOgY6/WQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hIDRKu48; 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="hIDRKu48" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2504F1F000E9; Thu, 28 May 2026 20:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779999522; bh=6xFFukG6CLUN/E4SK6Wqzg1+KdgwdqcnpgDaw2gyjNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hIDRKu48iYbqL/Et5BQJmpTCdAMINFl69d2HRpWVo/JUFgUXR2asgbbLKTTbeCjlk 5Bw1D4z+lYECUUA4ZKNub16ad5DAmAt6kbx9XwdqK3eDVO38Dn/PJW7K15bMQfzxGa Qbzv9bSjEEdMTThkxlClZ0mSE/Pc8bR8MPpvnt70= 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 6.18 097/377] igc: fix potential skb leak in igc_fpe_xmit_smd_frame() Date: Thu, 28 May 2026 21:45:35 +0200 Message-ID: <20260528194641.162493379@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194638.371537336@linuxfoundation.org> References: <20260528194638.371537336@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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; }