linux-stable/net/xfrm
Paul Davey a4b7606732 xfrm: Preserve vlan tags for transport mode software GRO
[ Upstream commit 58fbfecab9 ]

The software GRO path for esp transport mode uses skb_mac_header_rebuild
prior to re-injecting the packet via the xfrm_napi_dev.  This only
copies skb->mac_len bytes of header which may not be sufficient if the
packet contains 802.1Q tags or other VLAN tags.  Worse copying only the
initial header will leave a packet marked as being VLAN tagged but
without the corresponding tag leading to mangling when it is later
untagged.

The VLAN tags are important when receiving the decrypted esp transport
mode packet after GRO processing to ensure it is received on the correct
interface.

Therefore record the full mac header length in xfrm*_transport_input for
later use in corresponding xfrm*_transport_finish to copy the entire mac
header when rebuilding the mac header for GRO.  The skb->data pointer is
left pointing skb->mac_header bytes after the start of the mac header as
is expected by the network stack and network and transport header
offsets reset to this location.

Fixes: 7785bba299 ("esp: Add a software GRO codepath")
Signed-off-by: Paul Davey <paul.davey@alliedtelesis.co.nz>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-17 11:48:06 +02:00
..
espintcp.c net: Fix data-races around netdev_max_backlog. 2022-08-31 17:15:19 +02:00
Kconfig
Makefile xfrm: interface: rename xfrm_interface.c to xfrm_interface_core.c 2023-06-28 10:28:10 +02:00
xfrm_algo.c
xfrm_compat.c net: xfrm: Amend XFRMA_SEC_CTX nla_policy structure 2023-08-26 15:26:51 +02:00
xfrm_device.c xfrm: replay: Fix ESN wrap around for GSO 2022-12-02 17:39:58 +01:00
xfrm_hash.c
xfrm_hash.h
xfrm_inout.h
xfrm_input.c xfrm: Preserve vlan tags for transport mode software GRO 2024-05-17 11:48:06 +02:00
xfrm_interface_core.c xfrm: interface: use DEV_STATS_INC() 2023-10-25 11:54:19 +02:00
xfrm_ipcomp.c xfrm: Update ipcomp_scratches with NULL when freed 2022-10-26 13:25:46 +02:00
xfrm_output.c xfrm: remove the fragment check for ipv6 beet mode 2021-07-14 16:56:19 +02:00
xfrm_policy.c xfrm: fix a data-race in xfrm_gen_index() 2023-10-25 11:54:19 +02:00
xfrm_proc.c
xfrm_replay.c xfrm: replay: Fix ESN wrap around for GSO 2022-12-02 17:39:58 +01:00
xfrm_state.c xfrm: Allow transport-mode states with AF_UNSPEC selector 2023-03-22 13:29:55 +01:00
xfrm_sysctl.c
xfrm_user.c xfrm: Avoid clang fortify warning in copy_to_user_tmpl() 2024-04-13 12:58:49 +02:00