xfrm: Provide private skb extensions for segmented and hw offloaded ESP packets
authorSteffen Klassert <steffen.klassert@secunet.com>
Fri, 26 Mar 2021 08:44:48 +0000 (09:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:07 +0000 (08:42 +0200)
commit58f8f10740392dd25cac90470fb37308fb198f70
tree538e1e8bde0fe85e8ec5063b7fe9d9ee3f0e010f
parentbc0b89a9a28f9124476b01a0feb4ed65629201b2
xfrm: Provide private skb extensions for segmented and hw offloaded ESP packets

[ Upstream commit c7dbf4c08868d9db89b8bfe8f8245ca61b01ed2f ]

Commit 94579ac3f6d0 ("xfrm: Fix double ESP trailer insertion in IPsec
crypto offload.") added a XFRM_XMIT flag to avoid duplicate ESP trailer
insertion on HW offload. This flag is set on the secpath that is shared
amongst segments. This lead to a situation where some segments are
not transformed correctly when segmentation happens at layer 3.

Fix this by using private skb extensions for segmented and hw offloaded
ESP packets.

Fixes: 94579ac3f6d0 ("xfrm: Fix double ESP trailer insertion in IPsec crypto offload.")
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