ip6gre_header() pushes the outer IPv6 header and t->hlen bytes of GRE
header, but fills in only the IPv6 header and the base GRE header. When
the tunnel sends a checksum, a key or a sequence number, those fields
keep whatever was in the skb's headroom, and a packet socket bound to
the device copies them to user space.
Clear the whole header before filling it in.
Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
Suggested-by: Ido Schimmel <idos…@nvidia.com>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyuwon Cho <kyuw…@gmail.com>
---
net/ipv6/ip6_gre.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index b5d6ed8f0c36..9816c62c0c50 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1394,6 +1394,7 @@ static int ip6gre_header(struct sk_buff *skb, struct net_device *dev,
return -needed;
ipv6h = skb_push(skb, needed);
+ memset(ipv6h, 0, needed);
ip6_flow_hdr(ipv6h, 0, ip6_make_flowlabel(dev_net(dev), skb,
t->fl.u.ip6.flowlabel,
true, &t->fl.u.ip6));
--
2.43.0