xfrm: replay: Fix ESN wrap around for GSO
authorChristian Langrock <christian.langrock@secunet.com>
Mon, 17 Oct 2022 06:34:47 +0000 (08:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:02 +0000 (17:41 +0100)
commit0c69a4658e94d3d66b96c5c181ff32698c974a3b
tree20a6c2e8e8730e9b6461155f98dfa15de54bb67f
parentecc6ce4fdf0d62366604bc6a4cd6f50e19301a4e
xfrm: replay: Fix ESN wrap around for GSO

[ Upstream commit 4b549ccce941798703f159b227aa28c716aa78fa ]

When using GSO it can happen that the wrong seq_hi is used for the last
packets before the wrap around. This can lead to double usage of a
sequence number. To avoid this, we should serialize this last GSO
packet.

Fixes: d7dbefc45cf5 ("xfrm: Add xfrm_replay_overflow functions for offloading")
Co-developed-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Christian Langrock <christian.langrock@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/esp4_offload.c
net/ipv6/esp6_offload.c
net/xfrm/xfrm_device.c
net/xfrm/xfrm_replay.c