summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2011-03-15 21:12:49 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-21 14:32:34 -0700
commite5a1f3787f4b43e828de2818faa6a0f658b87a63 (patch)
tree37e3748d3101cdb40cd28ee52a46d51ee509f0e7 /net
parentedc45d1e743b8b5a9366b7cafb53c80f4267fe1f (diff)
downloadlinux-stable-e5a1f3787f4b43e828de2818faa6a0f658b87a63.tar.gz
linux-stable-e5a1f3787f4b43e828de2818faa6a0f658b87a63.tar.bz2
linux-stable-e5a1f3787f4b43e828de2818faa6a0f658b87a63.zip
xfrm: Refcount destination entry on xfrm_lookup
[ Upstream commit fbd5060875d25f7764fd1c3d35b83a8ed1d88d7b ] We return a destination entry without refcount if a socket policy is found in xfrm_lookup. This triggers a warning on a negative refcount when freeeing this dst entry. So take a refcount in this case to fix it. This refcount was forgotten when xfrm changed to cache bundles instead of policies for outgoing flows. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Acked-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/xfrm/xfrm_policy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 6459588befc3..8da2741d7997 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1778,6 +1778,8 @@ restart:
goto no_transform;
}
+ dst_hold(&xdst->u.dst);
+
spin_lock_bh(&xfrm_policy_sk_bundle_lock);
xdst->u.dst.next = xfrm_policy_sk_bundles;
xfrm_policy_sk_bundles = &xdst->u.dst;