diff options
| author | 2026-10-07 09:56:49 +0200 | |
|---|---|---|
| committer | 2026-10-08 10:54:42 -0700 | |
| commit | 056d046bf530d44bff5ce13a0addbc50c14ac95f (patch) | |
| tree | 28605f7b2f944ea4bb0c8cef442eca064f4b99b0 /scripts/Makefile.thinlto | |
| parent | selftests: net: big_tcp_tunnels: Fix the IPv6 route change (diff) | |
bng_en: pad short frames before sampling nr_frags
bnge_start_xmit() samples skb_shinfo(skb)->nr_frags into last_frag,
and stores it in tx_buf->nr_frags, before calling eth_skb_pad().
If a nonlinear skb is shorter than ETH_ZLEN, __skb_pad() calls
skb_linearize(), which pulls the frags into the linear part,
releases the frag pages and sets nr_frags to zero.
bnge_start_xmit() then uses the stale last_frag to fill TX_BD_CNT()
and to walk skb_shinfo(skb)->frags[], DMA-mapping pages the skb
no longer holds a reference on, and sending their content twice.
Fix this by calling eth_skb_pad() before nr_frags is sampled.
Found by Sashiko while reviewing the similar bnxt_en fix.
Fixes: bd5ad9c052c8 ("bng_en: Add TX support")
Link: https://lore.kernel.org/netdev/179134695789.434549.53526916334276884@kernel.org/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Vikas Gupta <vikas.gupta@broadcom.com>
Link: https://patch.msgid.link/20261007075649.468033-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
