]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.35/net-gro-fix-gro-flush-when-receiving-a-gso-packet.patch
Linux 4.19.35
[thirdparty/kernel/stable-queue.git] / releases / 4.19.35 / net-gro-fix-gro-flush-when-receiving-a-gso-packet.patch
CommitLineData
a9fba688
SL
1From 11296f76ac9c54c6baf15d74d5a0aa1363cf1897 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 8656b1e20d35..ceee28e184af 100644
29--- a/net/core/skbuff.c
30+++ b/net/core/skbuff.c
31@@ -3832,7 +3832,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