]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.8/net-gro-fix-gro-flush-when-receiving-a-gso-packet.patch
Linux 5.0.8
[thirdparty/kernel/stable-queue.git] / releases / 5.0.8 / net-gro-fix-gro-flush-when-receiving-a-gso-packet.patch
CommitLineData
6b6035bf
SL
1From 9f79e021de58e4682c44cef09f22ab02d4bef741 Mon Sep 17 00:00:00 2001
2From: Steffen Klassert <steffen.klassert@secunet.com>
3Date: Tue, 2 Apr 2019 08:16:03 +0200
4Subject: net-gro: Fix GRO flush when receiving a GSO packet.
5
6[ Upstream commit 0ab03f353d3613ea49d1f924faf98559003670a8 ]
7
8Currently we may merge incorrectly a received GSO packet
9or a packet with frag_list into a packet sitting in the
10gro_hash list. skb_segment() may crash case because
11the assumptions on the skb layout are not met.
12The correct behaviour would be to flush the packet in the
13gro_hash list and send the received GSO packet directly
14afterwards. Commit d61d072e87c8e ("net-gro: avoid reorders")
15sets NAPI_GRO_CB(skb)->flush in this case, but this is not
16checked before merging. This patch makes sure to check this
17flag and to not merge in that case.
18
19Fixes: d61d072e87c8e ("net-gro: avoid reorders")
20Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
21Signed-off-by: David S. Miller <davem@davemloft.net>
22Signed-off-by: Sasha Levin <sashal@kernel.org>
23---
24 net/core/skbuff.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/net/core/skbuff.c b/net/core/skbuff.c
28index 2415d9cb9b89..ef2cd5712098 100644
29--- a/net/core/skbuff.c
30+++ b/net/core/skbuff.c
31@@ -3801,7 +3801,7 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
32 unsigned int delta_truesize;
33 struct sk_buff *lp;
34
35- if (unlikely(p->len + len >= 65536))
36+ if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
37 return -E2BIG;
38
39 lp = NAPI_GRO_CB(p)->last;
40--
412.19.1
42