netfilter: nft_compat: narrow down revision to unsigned 8-bits
[platform/kernel/linux-starfive.git] / net / core / skbuff.c
index 6d204cf..011d690 100644 (file)
@@ -4508,8 +4508,9 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
                /* GSO partial only requires that we trim off any excess that
                 * doesn't fit into an MSS sized block, so take care of that
                 * now.
+                * Cap len to not accidentally hit GSO_BY_FRAGS.
                 */
-               partial_segs = len / mss;
+               partial_segs = min(len, GSO_BY_FRAGS - 1U) / mss;
                if (partial_segs > 1)
                        mss *= partial_segs;
                else