netfilter: flowtable: fix tcp and udp header checksum update
authorSven Auhagen <sven.auhagen@voleatech.de>
Tue, 2 Feb 2021 17:01:16 +0000 (18:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2021 10:02:26 +0000 (11:02 +0100)
commitbbb8c391486b717ac880145a0e848b88af89416e
tree7310e2c8d3882e9353968957554a5b5cb3786b7c
parent0a0e5d47670b753d3dbf88f3c77a97a30864d9bd
netfilter: flowtable: fix tcp and udp header checksum update

[ Upstream commit 8d6bca156e47d68551750a384b3ff49384c67be3 ]

When updating the tcp or udp header checksum on port nat the function
inet_proto_csum_replace2 with the last parameter pseudohdr as true.
This leads to an error in the case that GRO is used and packets are
split up in GSO. The tcp or udp checksum of all packets is incorrect.

The error is probably masked due to the fact the most network driver
implement tcp/udp checksum offloading. It also only happens when GRO is
applied and not on single packets.

The error is most visible when using a pppoe connection which is not
triggering the tcp/udp checksum offload.

Fixes: ac2a66665e23 ("netfilter: add generic flow table infrastructure")
Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_flow_table_core.c