aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_policy.c
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-05-29 03:36:25 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-31 20:30:07 -0400
commite4c1721642bbd42d8142f4811cde0588c28db51d (patch)
tree8f7750f6065dcb5d2bd727174fb9f4e3cd8fccf3 /net/xfrm/xfrm_policy.c
parent1e2bd517c108816220f262d7954b697af03b5f9c (diff)
xfrm: force a garbage collection after deleting a policy
In some cases after deleting a policy from the SPD the policy would remain in the dst/flow/route cache for an extended period of time which caused problems for SELinux as its dynamic network access controls key off of the number of XFRM policy and state entries. This patch corrects this problem by forcing a XFRM garbage collection whenever a policy is sucessfully removed. Reported-by: Ondrej Moris <omoris@redhat.com> Signed-off-by: Paul Moore <pmoore@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r--net/xfrm/xfrm_policy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 23cea0f74336..ea970b8002a2 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2557,11 +2557,12 @@ static void __xfrm_garbage_collect(struct net *net)
2557 } 2557 }
2558} 2558}
2559 2559
2560static void xfrm_garbage_collect(struct net *net) 2560void xfrm_garbage_collect(struct net *net)
2561{ 2561{
2562 flow_cache_flush(); 2562 flow_cache_flush();
2563 __xfrm_garbage_collect(net); 2563 __xfrm_garbage_collect(net);
2564} 2564}
2565EXPORT_SYMBOL(xfrm_garbage_collect);
2565 2566
2566static void xfrm_garbage_collect_deferred(struct net *net) 2567static void xfrm_garbage_collect_deferred(struct net *net)
2567{ 2568{