diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2014-06-18 06:34:21 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2014-06-26 01:52:42 -0400 |
commit | b7eea4545ea775df957460f58eb56085a8892856 (patch) | |
tree | 641c49c3387d197987924261652ace642d106c12 /net | |
parent | d7933ab727ed035bdf420d7381b831ba959cecc5 (diff) |
xfrm: Fix refcount imbalance in xfrm_lookup
xfrm_lookup must return a dst_entry with a refcount for the caller.
Git commit 1a1ccc96abb ("xfrm: Remove caching of xfrm_policy_sk_bundles")
removed this refcount for the socket policy case accidentally.
This patch restores it and sets DST_NOCACHE flag to make sure
that the dst_entry is freed when the refcount becomes null.
Fixes: 1a1ccc96abb ("xfrm: Remove caching of xfrm_policy_sk_bundles")
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net')
-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 a8ef5108e0d8..0525d78ba328 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -2097,6 +2097,8 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | |||
2097 | goto no_transform; | 2097 | goto no_transform; |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | dst_hold(&xdst->u.dst); | ||
2101 | xdst->u.dst.flags |= DST_NOCACHE; | ||
2100 | route = xdst->route; | 2102 | route = xdst->route; |
2101 | } | 2103 | } |
2102 | } | 2104 | } |