]> err.no Git - linux-2.6/commitdiff
[IPSEC]: Fix inetpeer leak in ipv4 xfrm dst entries.
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 7 Dec 2006 07:45:15 +0000 (23:45 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 7 Dec 2006 07:45:15 +0000 (23:45 -0800)
We grab a reference to the route's inetpeer entry but
forget to release it in xfrm4_dst_destroy().

Bug discovered by Kazunori MIYAZAWA <kazunori@miyazawa.org>

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/xfrm4_policy.c

index d4107bb701b58ba4492c68b51d902fb6e286b05a..fb9f69c616f5c3dbf43af6db14a8178aba46419b 100644 (file)
@@ -274,6 +274,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);
 }