diff mbox

[net,2/2] gue: fix remcsum when GRO on and CHECKSUM_PARTIAL boundary is outer UDP

Message ID 20170731160539.6013-1-den@klaipeden.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Koichiro Den July 31, 2017, 4:05 p.m. UTC
In the case that GRO is turned on and the original received packet is
CHECKSUM_PARTIAL, if the outer UDP header is exactly at the last
csum-unnecessary point, which for instance could occur if the packet
comes from another Linux guest on the same Linux host, we have to do
either remcsum_adjust or set up CHECKSUM_PARTIAL again with its
csum_start properly reset considering RCO.

However, since b7fe10e5ebac ("gro: Fix remcsum offload to deal with frags
in GRO") that barrier in such case could be skipped if GRO turned on,
hence we pass over it and the inner L4 validation mistakenly reckons
it as a bad csum.

This patch makes remcsum_offload being reset at the same time of GRO
remcsum cleanup, so as to make it work in such case as before.

Fixes: b7fe10e5ebac ("gro: Fix remcsum offload to deal with frags in GRO")
Signed-off-by: Koichiro Den <den@klaipeden.com>
---
 net/ipv4/fou.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Miller Aug. 1, 2017, 11:09 p.m. UTC | #1
From: Koichiro Den <den@klaipeden.com>
Date: Tue,  1 Aug 2017 01:05:39 +0900

> In the case that GRO is turned on and the original received packet is
> CHECKSUM_PARTIAL, if the outer UDP header is exactly at the last
> csum-unnecessary point, which for instance could occur if the packet
> comes from another Linux guest on the same Linux host, we have to do
> either remcsum_adjust or set up CHECKSUM_PARTIAL again with its
> csum_start properly reset considering RCO.
> 
> However, since b7fe10e5ebac ("gro: Fix remcsum offload to deal with frags
> in GRO") that barrier in such case could be skipped if GRO turned on,
> hence we pass over it and the inner L4 validation mistakenly reckons
> it as a bad csum.
> 
> This patch makes remcsum_offload being reset at the same time of GRO
> remcsum cleanup, so as to make it work in such case as before.
> 
> Fixes: b7fe10e5ebac ("gro: Fix remcsum offload to deal with frags in GRO")
> Signed-off-by: Koichiro Den <den@klaipeden.com>

Applied.
diff mbox

Patch

diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index 8e0257d01200..1540db65241a 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -450,6 +450,7 @@  static struct sk_buff **gue_gro_receive(struct sock *sk,
 out:
 	NAPI_GRO_CB(skb)->flush |= flush;
 	skb_gro_remcsum_cleanup(skb, &grc);
+	skb->remcsum_offload = 0;
 
 	return pp;
 }