Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/5] net: avoid truncated transport header offsets
@ 2026-11-13 12:46 Eric Dumazet
  2026-11-13 12:46 ` [PATCH net 1/5] ipv6: gro: limit the number of extension headers Eric Dumazet
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Eric Dumazet @ 2026-11-13 12:46 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, David Ahern, Ido Schimmel, Willem de Bruijn,
	Marcelo Ricardo Leitner, Xin Long, Aaron Conole, Eelco Chaudron,
	Ilya Maximets, Daniel Borkmann, Justin Iurman, Linus Lüssing,
	Sabrina Dubroca, Stefano Brivio, Hyunwoo Kim, netdev, linux-sctp,
	dev, Eric Dumazet

skb->transport_header is a 16-bit offset from skb->head, and U16_MAX
is reserved as the "not set" value. skb_set_transport_header() silently
truncates an offset that does not fit.

The first patch addresses the report from Hyunwoo Kim, by applying
the IP6_MAX_EXT_HDRS_CNT limit to ipv6_gro_pull_exthdrs().

The four following patches convert places storing an offset derived
from an IPv6 extension header walk to skb_set_transport_header_careful().
A single chain being bounded to 24576 bytes, these need a large
skb->data - skb->head to overflow, for instance after nested
decapsulations. They are hardening, no reproducer was written.

The same change for nf_ct_frag6_gather() is sent separately to
the netfilter tree.

Eric Dumazet (5):
  ipv6: gro: limit the number of extension headers
  ipv6: mcast: use skb_set_transport_header_careful() in
    ipv6_mc_check_exthdrs()
  net: openvswitch: use skb_set_transport_header_careful() in
    parse_ipv6hdr()
  sctp: use skb_set_transport_header_careful() in sctp_v6_err()
  udp: use skb_set_transport_header_careful() in __udp6_lib_err_encap()

 net/ipv6/ip6_offload.c | 8 ++++++++
 net/ipv6/mcast_snoop.c | 3 ++-
 net/ipv6/udp.c         | 7 ++++---
 net/openvswitch/flow.c | 3 ++-
 net/sctp/ipv6.c        | 5 ++++-
 5 files changed, 20 insertions(+), 6 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-11-13 12:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 12:46 [PATCH net 0/5] net: avoid truncated transport header offsets Eric Dumazet
2026-11-13 12:46 ` [PATCH net 1/5] ipv6: gro: limit the number of extension headers Eric Dumazet
2026-11-13 12:58   ` Hyunwoo Kim
2026-11-13 12:46 ` [PATCH net 2/5] ipv6: mcast: use skb_set_transport_header_careful() in ipv6_mc_check_exthdrs() Eric Dumazet
2026-11-13 12:46 ` [PATCH net 3/5] net: openvswitch: use skb_set_transport_header_careful() in parse_ipv6hdr() Eric Dumazet
2026-11-13 12:46 ` [PATCH net 4/5] sctp: use skb_set_transport_header_careful() in sctp_v6_err() Eric Dumazet
2026-11-13 12:46 ` [PATCH net 5/5] udp: use skb_set_transport_header_careful() in __udp6_lib_err_encap() Eric Dumazet

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