]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[IPSEC]: Fix inetpeer leak in ipv4 xfrm dst entries.
authorDavid S. Miller <davem@davemloft.net>
Sat, 9 Dec 2006 15:16:56 +0000 (16:16 +0100)
committerAdrian Bunk <bunk@stusta.de>
Sat, 9 Dec 2006 15:16:56 +0000 (16:16 +0100)
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: Adrian Bunk <bunk@stusta.de>
net/ipv4/xfrm4_policy.c

index f285bbf296e28d79099887afa2882be75ddf32bc..09553605fba52188dc9d2c18e7b9a1da8036a42e 100644 (file)
@@ -257,6 +257,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);
 }