Files
linux/net/core
Eric Dumazet ab9a9a9e96 net: add more sanity checks to qdisc_pkt_len_init()
One path takes care of SKB_GSO_DODGY, assuming
skb->len is bigger than hdr_len.

virtio_net_hdr_to_skb() does not fully dissect TCP headers,
it only make sure it is at least 20 bytes.

It is possible for an user to provide a malicious 'GSO' packet,
total length of 80 bytes.

- 20 bytes of IPv4 header
- 60 bytes TCP header
- a small gso_size like 8

virtio_net_hdr_to_skb() would declare this packet as a normal
GSO packet, because it would see 40 bytes of payload,
bigger than gso_size.

We need to make detect this case to not underflow
qdisc_skb_cb(skb)->pkt_len.

Fixes: 1def9238d4 ("net_sched: more precise pkt_len computation")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-10-01 11:47:05 +02:00
..
2024-06-24 16:41:23 -07:00
2024-09-11 20:44:32 -07:00
2024-03-07 21:12:41 -08:00
2024-04-01 10:49:28 +01:00
2024-09-11 20:44:32 -07:00
2024-09-11 20:44:31 -07:00
2024-09-06 18:24:59 -07:00
2024-09-02 18:43:58 +02:00
2024-06-06 11:52:52 +02:00
2022-12-12 15:04:39 -08:00
2024-08-26 09:37:23 -07:00