[lkml]   [2011]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[27/70] xfrm: Refcount destination entry on xfrm_lookup
2.6.38-stable review patch.  If anyone has any objections, please let us know.


From: Steffen Klassert <>

[ 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 <>
Acked-by: Timo Teräs <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>
net/xfrm/xfrm_policy.c | 2 ++
1 file changed, 2 insertions(+)
--- 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);
xdst-> = xfrm_policy_sk_bundles;
xfrm_policy_sk_bundles = &xdst->u.dst;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2011-04-19 22:29    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean