]> git.itanic.dy.fi Git - linux-stable/commit
xfrm: fix dflt policy check when there is no policy configured
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Mon, 22 Nov 2021 10:33:13 +0000 (11:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 07:17:57 +0000 (09:17 +0200)
commit57c1bbe7098b516d535295a9fa762a44c871a74c
treed5eb30c396fad3179cc986d32a611578819f4fc3
parent9856c3a129dd625c26df92fc58dda739741204ff
xfrm: fix dflt policy check when there is no policy configured

[ Upstream commit ec3bb890817e4398f2d46e12e2e205495b116be9 ]

When there is no policy configured on the system, the default policy is
checked in xfrm_route_forward. However, it was done with the wrong
direction (XFRM_POLICY_FWD instead of XFRM_POLICY_OUT).
The default policy for XFRM_POLICY_FWD was checked just before, with a call
to xfrm[46]_policy_check().

CC: stable@vger.kernel.org
Fixes: 2d151d39073a ("xfrm: Add possibility to set the default to block if we have no policy")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/xfrm.h