diff options
author | David Miller <davem@davemloft.net> | 2006-12-07 00:40:36 -0800 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2006-12-11 11:32:39 -0800 |
commit | 5bcd4af5fcd996bdd309bf506a60c6217810b1c6 (patch) | |
tree | 208adf2f6f5a0e0ecaa97069ad8ad94533fc2e0f | |
parent | 53f9565904925cf3cf5d059c245cee2c974e5508 (diff) | |
download | lwn-5bcd4af5fcd996bdd309bf506a60c6217810b1c6.tar.gz lwn-5bcd4af5fcd996bdd309bf506a60c6217810b1c6.zip |
[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 <kazunori@miyazawa.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r-- | net/ipv4/xfrm4_policy.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 1bed0cdf53e3..2cf784004372 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); } |