]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] IPSEC: Fix inetpeer leak in ipv4 xfrm dst entries.
authorDavid Miller <davem@davemloft.net>
Thu, 7 Dec 2006 08:40:36 +0000 (00:40 -0800)
committerChris Wright <chrisw@sous-sol.org>
Sun, 17 Dec 2006 00:20:47 +0000 (16:20 -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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/ipv4/xfrm4_policy.c

index 8f50eae47d039e3d1fbb69dac42db60e1eb1b53e..eae687d4db6ed85dbdb10bfcd20c57058aad1ca1 100644 (file)
@@ -252,6 +252,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);
 }