diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2019-04-02 08:16:03 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-17 08:37:46 +0200 |
commit | 23bfd229819139b6a9635e6efb9d2fa0309b3de2 (patch) | |
tree | 7ba2134b72f3b0ea035c2a7e20c5be9bd7bdc139 /net/core | |
parent | 393c8b4c6790c21d7f639c47436b13e975eee7b1 (diff) |
net-gro: Fix GRO flush when receiving a GSO packet.
[ Upstream commit 0ab03f353d3613ea49d1f924faf98559003670a8 ]
Currently we may merge incorrectly a received GSO packet
or a packet with frag_list into a packet sitting in the
gro_hash list. skb_segment() may crash case because
the assumptions on the skb layout are not met.
The correct behaviour would be to flush the packet in the
gro_hash list and send the received GSO packet directly
afterwards. Commit d61d072e87c8e ("net-gro: avoid reorders")
sets NAPI_GRO_CB(skb)->flush in this case, but this is not
checked before merging. This patch makes sure to check this
flag and to not merge in that case.
Fixes: d61d072e87c8e ("net-gro: avoid reorders")
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skbuff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 1b39aef5cf82..2b3b0307dd89 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3808,7 +3808,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) struct sk_buff *lp, *p = *head; unsigned int delta_truesize; - if (unlikely(p->len + len >= 65536)) + if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush)) return -E2BIG; lp = NAPI_GRO_CB(p)->last; |