OSDN Git Service

net: gre: recompute gre csum for sctp over gre tunnels
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 31 Jul 2020 18:12:05 +0000 (20:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2020 22:29:44 +0000 (15:29 -0700)
commit622e32b7d4a6492cf5c1f759ef833f817418f7b3
tree29166865c6ad5ceeeb65d3f2aefe10e511b40b1e
parentfd65e5a95d08389444e8591a20538b3edece0e15
net: gre: recompute gre csum for sctp over gre tunnels

The GRE tunnel can be used to transport traffic that does not rely on a
Internet checksum (e.g. SCTP). The issue can be triggered creating a GRE
or GRETAP tunnel and transmitting SCTP traffic ontop of it where CRC
offload has been disabled. In order to fix the issue we need to
recompute the GRE csum in gre_gso_segment() not relying on the inner
checksum.
The issue is still present when we have the CRC offload enabled.
In this case we need to disable the CRC offload if we require GRE
checksum since otherwise skb_checksum() will report a wrong value.

Fixes: 90017accff61 ("sctp: Add GSO support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/gre_offload.c