From: David Miller Date: Thu, 7 Dec 2006 08:40:36 +0000 (-0800) Subject: [PATCH] IPSEC: Fix inetpeer leak in ipv4 xfrm dst entries. X-Git-Tag: v2.6.19.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bcd4af5fcd996bdd309bf506a60c6217810b1c6;p=thirdparty%2Fkernel%2Fstable.git [PATCH] IPSEC: Fix inetpeer leak in ipv4 xfrm dst entries. We grab a reference to the route's inetpeer entry but forget to release it in xfrm4_dst_destroy(). Bug discovered by Kazunori MIYAZAWA Signed-off-by: David S. Miller Signed-off-by: Chris Wright --- diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 1bed0cdf53e30..2cf784004372d 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -273,6 +273,8 @@ static void xfrm4_dst_destroy(struct dst_entry *dst) if (likely(xdst->u.rt.idev)) in_dev_put(xdst->u.rt.idev); + if (likely(xdst->u.rt.peer)) + inet_putpeer(xdst->u.rt.peer); xfrm_dst_destroy(xdst); }