summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorChris Mason <mason@kernel.org>2026-11-01 19:05:34 +0000
committerAlexei Starovoitov <ast@kernel.org>2026-11-02 00:10:40 +0000
commit33be492c2e239de8c525254e593357ae5e80852d (patch)
tree5abc258769d699510f9b6289ec3fa3e15533b122 /scripts/basic
parenta9d08fe60fa728ce0e3a99085241e8e790fb14c6 (diff)
downloadlinux-33be492c2e239de8c525254e593357ae5e80852d.tar.gz
linux-33be492c2e239de8c525254e593357ae5e80852d.zip
bpf: Use the inner transport header after a decap
If skb->encapsulation is set, qdisc_pkt_len_segs_init() reads the TCP header of a GSO packet at skb->inner_transport_header. Otherwise it uses skb->transport_header. A decap with BPF_F_ADJ_ROOM_DECAP_L4_{GRE,UDP} removes the outer transport header. It clears skb->encapsulation if no tunnel flag remains in gso_type. The result in BPF_ADJ_ROOM_MAC mode is: before | MAC | outer IP | GRE | inner IP | TCP | payload transport_header ^ ^ inner_transport_header after | MAC | inner IP | TCP | payload transport_header ^ ^ inner_transport_header Then qdisc_pkt_len_segs_init() reads the inner IP header as a TCP header. Thus the kernel can drop a valid packet with SKB_DROP_REASON_SKB_BAD_GSO. Copy skb->inner_transport_header to skb->transport_header when a decap clears skb->encapsulation. Keep skb->transport_header if it is larger. This occurs if nothing sets the inner field. At tc ingress nothing changes for IPIP or GRO packets. Both fields are at the TCP header there. Fixes: ec20dee2f2c4 ("bpf: Clear decap state on skb_adjust_room shrink path") Signed-off-by: Chris Mason <mason@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20261101190535.1454146-27-alexei.starovoitov@gmail.com
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions