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:39:58 +0000 (17:39 +0100)
commit51969d679ba4567e10f6c15061d1dad1063406e7
tree5d43cd427d340fe7b4b5a6f573e0bf4eadf70f8c
parent497653f6d2392c8d4abb041f01e1a19781d995d0
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