diff --git a/net/core/dev.c b/net/core/dev.c index 403aa18c07ac..7e92048b9696 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3200,6 +3200,9 @@ static netdev_features_t gso_features_check(const struct sk_buff *skb, if (gso_segs > dev->gso_max_segs) return features & ~NETIF_F_GSO_MASK; + if (unlikely(skb->len >= READ_ONCE(dev->gso_max_size))) + return features & ~NETIF_F_GSO_MASK; + if (!skb_shinfo(skb)->gso_type) { skb_warn_bad_offload(skb); return features & ~NETIF_F_GSO_MASK;