xfrm: policy: check reinserted policies match their node
authorFlorian Westphal <fw@strlen.de>
Wed, 7 Nov 2018 22:00:39 +0000 (23:00 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 9 Nov 2018 10:58:13 +0000 (11:58 +0100)
commite901cbc29316fb06423de5dfbc5afb78d4efda53
treea2bc4990aff87c1f8bd57424b88cb32c2e8251d9
parent9cf545ebd591da673bb6b6c88150212ad83567a9
xfrm: policy: check reinserted policies match their node

validate the re-inserted policies match the lookup node.
Policies that fail this test won't be returned in the candidate set.

This is enabled by default for now, it should not cause noticeable
reinsert slow down.

Such reinserts are needed when we have to merge an existing node
(e.g. for 10.0.0.0/28 because a overlapping subnet was added (e.g.
10.0.0.0/24), so whenever this happens existing policies have to
be placed on the list of the new node.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_policy.c