kernel_optimize_test/net/xfrm
Visa Hankala 6daa52884c xfrm: Fix wraparound in xfrm_policy_addr_delta()
[ Upstream commit da64ae2d35d3673233f0403b035d4c6acbf71965 ]

Use three-way comparison for address components to avoid integer
wraparound in the result of xfrm_policy_addr_delta(). This ensures
that the search trees are built and traversed correctly.

Treat IPv4 and IPv6 similarly by returning 0 when prefixlen == 0.
Prefix /0 has only one equivalence class.

Fixes: 9cf545ebd5 ("xfrm: policy: store inexact policies in a tree ordered by destination address")
Signed-off-by: Visa Hankala <visa@hankala.org>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-03 23:28:45 +01:00
..
espintcp.c
Kconfig
Makefile
xfrm_algo.c
xfrm_compat.c
xfrm_device.c
xfrm_hash.c
xfrm_hash.h
xfrm_inout.h
xfrm_input.c
xfrm_interface.c
xfrm_ipcomp.c
xfrm_output.c
xfrm_policy.c xfrm: Fix wraparound in xfrm_policy_addr_delta() 2021-02-03 23:28:45 +01:00
xfrm_proc.c
xfrm_replay.c
xfrm_state.c
xfrm_sysctl.c
xfrm_user.c