diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2011-03-15 17:12:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-16 15:55:36 -0400 |
commit | fbd5060875d25f7764fd1c3d35b83a8ed1d88d7b (patch) | |
tree | 2b92c1c37178af438bd0f2b1573b61cb64117418 /net/xfrm | |
parent | 8a4eb5734e8d1dc60a8c28576bbbdfdcc643626d (diff) |
xfrm: Refcount destination entry on xfrm_lookup
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>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 027e3c6fb7e4..15792d8b6272 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1804,6 +1804,8 @@ restart: | |||
1804 | goto no_transform; | 1804 | goto no_transform; |
1805 | } | 1805 | } |
1806 | 1806 | ||
1807 | dst_hold(&xdst->u.dst); | ||
1808 | |||
1807 | spin_lock_bh(&xfrm_policy_sk_bundle_lock); | 1809 | spin_lock_bh(&xfrm_policy_sk_bundle_lock); |
1808 | xdst->u.dst.next = xfrm_policy_sk_bundles; | 1810 | xdst->u.dst.next = xfrm_policy_sk_bundles; |
1809 | xfrm_policy_sk_bundles = &xdst->u.dst; | 1811 | xfrm_policy_sk_bundles = &xdst->u.dst; |