]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: pull headers in qdisc_pkt_len_segs_init()
authorEric Dumazet <edumazet@google.com>
Fri, 3 Apr 2026 22:15:40 +0000 (22:15 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Apr 2026 02:02:13 +0000 (19:02 -0700)
commit7fb4c19670110f052c04e1ec1d2b953b9f4f57e4
tree48975e0807d9dea713a664008e159052ca6eba3c
parent30e02ec3b4b6bd429a4824f125eb843a291dcccf
net: pull headers in qdisc_pkt_len_segs_init()

Most ndo_start_xmit() methods expects headers of gso packets
to be already in skb->head.

net/core/tso.c users are particularly at risk, because tso_build_hdr()
does a memcpy(hdr, skb->data, hdr_len);

qdisc_pkt_len_segs_init() already does a dissection of gso packets.

Use pskb_may_pull() instead of skb_header_pointer() to make
sure drivers do not have to reimplement this.

Some malicious packets could be fed, detect them so that we can
drop them sooner with a new SKB_DROP_REASON_SKB_BAD_GSO drop_reason.

Fixes: e876f208af18 ("net: Add a software TSO helper API")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260403221540.3297753-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/dropreason-core.h
net/core/dev.c