Commit
ce93718fb7cdbc064c3000ff59e4d3200bdfa744 ("net: Don't keep
around original SKB when we software segment GSO frames") frees the
original skb after software GSO even for dodgy gso skbs. This breaks
the stream throughput from untrusted sources, since only header
checking was done during software GSO instead of a true
segmentation. This patch fixes this by freeing the original gso skb
only when it was really segmented by software.
Fixes
ce93718fb7cdbc064c3000ff59e4d3200bdfa744 ("net: Don't keep
around original SKB when we software segment GSO frames.")
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
struct sk_buff *segs;
segs = skb_gso_segment(skb, features);
- kfree_skb(skb);
- if (IS_ERR(segs))
+ if (IS_ERR(segs)) {
segs = NULL;
- skb = segs;
+ } else if (segs) {
+ consume_skb(skb);
+ skb = segs;
+ }
} else {
if (skb_needs_linearize(skb, features) &&
__skb_linearize(skb))