diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-11-17 08:18:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-17 08:18:18 -0500 |
commit | 69c0cab120a85471054614418b447349caba22d7 (patch) | |
tree | 6ab6f5ee4d0e605c61280f2b1eaa57e94001bde6 | |
parent | e54d5512b600aa0d492010436ff7eb0c9194efc1 (diff) |
gro: Fix illegal merging of trailer trash
When we've merged skb's with page frags, and subsequently receive
a trailer skb (< MSS) that is not completely non-linear (this can
occur on Intel NICs if the packet size falls below the threshold),
GRO ends up producing an illegal GSO skb with a frag_list.
This is harmless unless the skb is then forwarded through an
interface that requires software GSO, whereupon the GSO code
will BUG.
This patch detects this case in GRO and avoids merging the
trailer skb.
Reported-by: Mark Wagner <mwagner@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/skbuff.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 80a96166df39..ec85681a7dd8 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2701,7 +2701,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2701 | 2701 | ||
2702 | NAPI_GRO_CB(skb)->free = 1; | 2702 | NAPI_GRO_CB(skb)->free = 1; |
2703 | goto done; | 2703 | goto done; |
2704 | } | 2704 | } else if (skb_gro_len(p) != pinfo->gso_size) |
2705 | return -E2BIG; | ||
2705 | 2706 | ||
2706 | headroom = skb_headroom(p); | 2707 | headroom = skb_headroom(p); |
2707 | nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p)); | 2708 | nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p)); |