]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5d27de805cfa5173ab6a1671556c50ec5892fdb3
tree29166865c6ad5ceeeb65d3f2aefe10e511b40b1e
parente5f5ec92f6a649a3b433bec6cc07677028696be7
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: 0a12a535320a ("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