From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, andrew+netdev@lunn.ch,
netdev@vger.kernel.org
Cc: Kohei Enju <kohei@enjuk.jp>,
anthony.l.nguyen@intel.com, dima.ruinskiy@intel.com,
faizal.abdul.rahim@linux.intel.com, chwee.lin.choong@intel.com,
kohei.enju@gmail.com, vladimir.oltean@nxp.com,
stable@vger.kernel.org, Simon Horman <horms@kernel.org>,
Avigail Dahan <avigailx.dahan@intel.com>
Subject: [PATCH net 09/10] igc: fix potential skb leak in igc_fpe_xmit_smd_frame()
Date: Fri, 15 May 2026 11:24:16 -0700 [thread overview]
Message-ID: <20260515182419.1597859-10-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20260515182419.1597859-1-anthony.l.nguyen@intel.com>
From: Kohei Enju <kohei@enjuk.jp>
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 <kohei@enjuk.jp>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/igc/igc_tsn.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
index 725ba253165c..52de2bcbadbe 100644
--- a/drivers/net/ethernet/intel/igc/igc_tsn.c
+++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
@@ -110,10 +110,16 @@ static int igc_fpe_xmit_smd_frame(struct igc_adapter *adapter,
__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;
}
--
2.47.1
next prev parent reply other threads:[~2026-05-15 18:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 18:24 [PATCH net 00/10][pull request] Intel Wired LAN Driver Updates 2026-05-15 (ice, ixgbevf, igc, e1000e) Tony Nguyen
2026-05-15 18:24 ` [PATCH net 01/10] ice: fix locking around wait_event_interruptible_locked_irq Tony Nguyen
2026-05-15 18:24 ` [PATCH net 02/10] ice: fix VF queue configuration with low MTU values Tony Nguyen
2026-05-15 18:24 ` [PATCH net 03/10] ice: fix setting promisc mode while adding VID filter Tony Nguyen
2026-05-15 18:24 ` [PATCH net 04/10] ice: ptp: serialize E825 PHY timer start with PTP lock Tony Nguyen
2026-05-15 18:24 ` [PATCH net 05/10] ice: ptp: use primary NAC semaphore on E825 Tony Nguyen
2026-05-15 18:24 ` [PATCH net 06/10] ice: restore PTP Rx timestamp config after ethtool set-channels Tony Nguyen
2026-05-15 18:24 ` [PATCH net 07/10] ixgbevf: fix use-after-free in VEPA multicast source pruning Tony Nguyen
2026-05-15 18:24 ` [PATCH net 08/10] igc: set tx buffer type for SMD frames Tony Nguyen
2026-05-15 18:24 ` Tony Nguyen [this message]
2026-05-15 18:24 ` [PATCH net 10/10] e1000e: correct TIMINCA on ADP/TGP systems with wrong XTAL frequency Tony Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260515182419.1597859-10-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=avigailx.dahan@intel.com \
--cc=chwee.lin.choong@intel.com \
--cc=davem@davemloft.net \
--cc=dima.ruinskiy@intel.com \
--cc=edumazet@google.com \
--cc=faizal.abdul.rahim@linux.intel.com \
--cc=horms@kernel.org \
--cc=kohei.enju@gmail.com \
--cc=kohei@enjuk.jp \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox