All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: "David S. Miller" <davem@redhat.com>
Cc: vnuorval@tcs.hut.fi, kuznet@ms2.inr.ac.ru, kazunori@miyazawa.org,
	netdev@oss.sgi.com, usagi@linux-ipv6.org, latten@austin.ibm.com
Subject: Re: [PATCH][IPV6] fixed authentication error with TCP
Date: Mon, 18 Aug 2003 03:36:08 -0700	[thread overview]
Message-ID: <20030818033608.35c86539.davem@redhat.com> (raw)
In-Reply-To: <20030818024837.6815f0c2.davem@redhat.com>

On Mon, 18 Aug 2003 02:48:37 -0700
"David S. Miller" <davem@redhat.com> wrote:

> While verifying this patch, I discovered some new dst leaks.

This patch fixes them up.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1209  -> 1.1210 
#	net/ipv6/ip6_output.c	1.42    -> 1.43   
#	     net/ipv6/icmp.c	1.39    -> 1.40   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/18	davem@nuts.ninka.net	1.1210
# [IPV6]: Fix some dst cache leaks.
# 1) icmpv6_send() and icmpv6_echo_reply() never release dst.
# 2) ip6_{push,flush}_pending_frames() leak np->cork.rt.
# --------------------------------------------
#
diff -Nru a/net/ipv6/icmp.c b/net/ipv6/icmp.c
--- a/net/ipv6/icmp.c	Mon Aug 18 03:39:55 2003
+++ b/net/ipv6/icmp.c	Mon Aug 18 03:39:55 2003
@@ -356,7 +356,8 @@
 		fl.oif = np->mcast_oif;
 
 	err = ip6_dst_lookup(sk, &dst, &fl);
-	if (err) goto out;
+	if (err)
+		goto out;
 
 	if (hlimit < 0) {
 		if (ipv6_addr_is_multicast(&fl.fl6_dst))
@@ -375,7 +376,7 @@
 		if (net_ratelimit())
 			printk(KERN_DEBUG "icmp: len problem\n");
 		__skb_push(skb, plen);
-		goto out;
+		goto out_dst_release;
 	}
 
 	idev = in6_dev_get(skb->dev);
@@ -396,6 +397,8 @@
 out_put:
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
+out_dst_release:
+	dst_release(dst);
 out:
 	icmpv6_xmit_unlock();
 }
@@ -435,8 +438,8 @@
 		fl.oif = np->mcast_oif;
 
 	err = ip6_dst_lookup(sk, &dst, &fl);
-
-	if (err) goto out;
+	if (err)
+		goto out;
 
 	if (hlimit < 0) {
 		if (ipv6_addr_is_multicast(&fl.fl6_dst))
@@ -465,6 +468,7 @@
 out_put: 
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
+	dst_release(dst);
 out: 
 	icmpv6_xmit_unlock();
 }
diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c	Mon Aug 18 03:39:55 2003
+++ b/net/ipv6/ip6_output.c	Mon Aug 18 03:39:55 2003
@@ -1484,6 +1484,7 @@
 		np->cork.opt = NULL;
 	}
 	if (np->cork.rt) {
+		dst_release(&np->cork.rt->u.dst);
 		np->cork.rt = NULL;
 	}
 	if (np->cork.fl) {
@@ -1510,6 +1511,7 @@
 		np->cork.opt = NULL;
 	}
 	if (np->cork.rt) {
+		dst_release(&np->cork.rt->u.dst);
 		np->cork.rt = NULL;
 	}
 	if (np->cork.fl) {

  reply	other threads:[~2003-08-18 10:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06  7:44 [PATCH][IPV6] fixed authentication error with TCP Kazunori Miyazawa
2003-08-08  5:05 ` David S. Miller
2003-08-17 23:29   ` kuznet
2003-08-18  7:45     ` Ville Nuorvala
2003-08-18  7:45       ` David S. Miller
2003-08-18  9:32       ` Kazunori Miyazawa
2003-08-18  9:48       ` David S. Miller
2003-08-18 10:36         ` David S. Miller [this message]
2003-08-18 10:11       ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030818033608.35c86539.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=kazunori@miyazawa.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=latten@austin.ibm.com \
    --cc=netdev@oss.sgi.com \
    --cc=usagi@linux-ipv6.org \
    --cc=vnuorval@tcs.hut.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.