linux-stable/net/xfrm
Benedict Wong 0b892d8fe9 Fix XFRM-I support for nested ESP tunnels
[ Upstream commit b0355dbbf1 ]

This change adds support for nested IPsec tunnels by ensuring that
XFRM-I verifies existing policies before decapsulating a subsequent
policies. Addtionally, this clears the secpath entries after policies
are verified, ensuring that previous tunnels with no-longer-valid
do not pollute subsequent policy checks.

This is necessary especially for nested tunnels, as the IP addresses,
protocol and ports may all change, thus not matching the previous
policies. In order to ensure that packets match the relevant inbound
templates, the xfrm_policy_check should be done before handing off to
the inner XFRM protocol to decrypt and decapsulate.

Notably, raw ESP/AH packets did not perform policy checks inherently,
whereas all other encapsulated packets (UDP, TCP encapsulated) do policy
checks after calling xfrm_input handling in the respective encapsulation
layer.

Test: Verified with additional Android Kernel Unit tests
Signed-off-by: Benedict Wong <benedictwong@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-03 11:52:20 +01:00
..
espintcp.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
Kconfig
Makefile
xfrm_algo.c
xfrm_compat.c xfrm/compat: prevent potential spectre v1 gadget in xfrm_xlate32_attr() 2023-02-14 19:11:42 +01:00
xfrm_device.c xfrm: replay: Fix ESN wrap around for GSO 2022-10-19 09:00:53 +02:00
xfrm_hash.c
xfrm_hash.h
xfrm_inout.h
xfrm_input.c xfrm: fix bug with DSCP copy to v6 from v4 tunnel 2023-02-14 19:11:43 +01:00
xfrm_interface.c Fix XFRM-I support for nested ESP tunnels 2023-03-03 11:52:20 +01:00
xfrm_ipcomp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-03 17:44:18 -07:00
xfrm_output.c Revert "xfrm: update SA curlft.use_time" 2022-08-03 07:27:37 +02:00
xfrm_policy.c Fix XFRM-I support for nested ESP tunnels 2023-03-03 11:52:20 +01:00
xfrm_proc.c
xfrm_replay.c xfrm: replay: Fix ESN wrap around for GSO 2022-10-19 09:00:53 +02:00
xfrm_state.c xfrm: annotate data-race around use_time 2023-02-14 19:11:43 +01:00
xfrm_sysctl.c
xfrm_user.c xfrm: add extack support to xfrm_init_replay 2022-09-22 07:36:08 +02:00