xfrm: Fix refcount imbalance in xfrm_lookup
authorSteffen Klassert <steffen.klassert@secunet.com>
Wed, 18 Jun 2014 10:34:21 +0000 (12:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Aug 2014 01:51:47 +0000 (09:51 +0800)
commitc4b76e18681b8574f61bdf95981270c94ae82938
tree01bc23b659a09beda7a7eddaf30b13c1ea0e1083
parent34ada3629e591ddb43c1aa799f5e4f39b1a1597a
xfrm: Fix refcount imbalance in xfrm_lookup

[ Upstream commit b7eea4545ea775df957460f58eb56085a8892856 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_policy.c