On Sat, Dec 5, 2026, at 8:30 AM, sash…@kernel.org wrote:
> Can casting skb_inner_transport_offset(skb) to s16 clobber valid offsets
> >= 32768 and fail to reset offsets < -32768?
> > virtio_net_hdr_tnl_to_skb() can set inner_transport_header from csum_start > up to U16_MAX - 1 via skb_partial_csum_set(). Under the s16 cast, offsets
> >= 32768 sign-extend negative and are overwritten with off.
That takes a made-up virtio header. Every segment repeats all of the headers, so with 32 KiB of them, none would fit an Ethernet MTU.
> An unset inner_transport_header at 0 then has an offset below > -32768, which wraps positive under s16 and skips the reset.
The decap still gets this one right. bpf_skb_clear_encap() takes the larger of the two headers, and that's the outer one then.
> Does resetting a wrapped inner_transport_header to off misplace it when > skb->encapsulation stays set, while leaving the GRO bug unfixed?
It looks like this doesn't make anything worse. A wrapped offset is about 65,000 bytes into the packet, so qdisc_pkt_len_segs_init() already drops it without the patch. The GRO bug is real, and Julius Bairaktaris has posted a fix for it: https://lore.kernel.org/all/bf33…@bairaktaris.de/ -chris