Netdev List
 help / color / mirror / Atom feed
* [PATCH ipsec] xfrm: iptfs: initialize unset MAC headers on inner skbs
@ 2026-12-04  5:12 Kyuwon Cho
  2026-12-05  5:54 ` netdev-bot+sashiko
  0 siblings, 1 reply; 2+ messages in thread
From: Kyuwon Cho @ 2026-12-04  5:12 UTC (permalink / raw)
  To: Steffen Klassert, Herbert Xu
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Willem de Bruijn, Simon Horman, Christian Hopps, netdev, ipsec

iptfs_alloc_skb() leaves the MAC header unset.  When reassembly completes,
iptfs_complete_inner_skb() sends the inner skb through gro_cells_receive()
without initializing it.  An AF_PACKET listener then derives a large push
length from the unset header and trips skb_under_panic():

  kernel BUG at net/core/skbuff.c:215!
  RIP: 0010:skb_panic (net/core/skbuff.c:215)
  Call Trace:
   <IRQ>
   skb_push.cold (net/core/skbuff.c:225 net/core/skbuff.c:2680)
   packet_rcv (net/packet/af_packet.c:2195)
   __netif_receive_skb_core.constprop.0
     (net/core/dev.c:2581 net/core/dev.c:6397)
   gro_cell_poll (net/core/gro_cells.c:79)

Reset the MAC header to the start of the inner packet when it is unset.
Preserve a valid L2 header when the receive path rebuilt one from the outer
skb.

Fixes: 6c82d2433671 ("xfrm: iptfs: add basic receive packet (tunnel egress) handling")
Signed-off-by: Kyuwon Cho <kyuwon.cho@skku.edu>
---
This issue was found by an LLM-guided test generator used in our research prototype.
A reproducer is available on request.

 net/xfrm/xfrm_iptfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c
index 76272b0a1829..22f83e25a86e 100644
--- a/net/xfrm/xfrm_iptfs.c
+++ b/net/xfrm/xfrm_iptfs.c
@@ -665,6 +665,8 @@ static u32 __iptfs_iplen(u8 *data)
  */
 static void iptfs_complete_inner_skb(struct xfrm_state *x, struct sk_buff *skb)
 {
+	if (!skb_mac_header_was_set(skb))
+		skb_reset_mac_header(skb);
 	skb_reset_network_header(skb);
 
 	/* The packet is going back through gro_cells_receive no need to
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-05  5:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  5:12 [PATCH ipsec] xfrm: iptfs: initialize unset MAC headers on inner skbs Kyuwon Cho
2026-12-05  5:54 ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox