All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Cc: Strobl Anton <a.strobl@aws-it.at>,
	linux-kernel@vger.kernel.org, Netdev <netdev@vger.kernel.org>
Subject: Re: OOPS iproute2/tc/u32_destroy in 2.6.22-rc3-git6
Date: Sun, 03 Jun 2007 18:36:34 +0200	[thread overview]
Message-ID: <4662EE12.1080400@trash.net> (raw)
In-Reply-To: <4662D881.5080600@googlemail.com>

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

Michal Piotrowski wrote:
> Strobl Anton pisze:
> 
>> While trying to stop qdisc/cbq with command
>>
>>    tc qdisc del dev eth1 root
>>
>> EIP is at u32_destroy+0x52/0xd8 [cls_u32]


Please try this patch.


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1639 bytes --]

[NET_SCHED]: Fix filter double free

cbq and atm destroy their filters twice when destroying inner classes
during qdisc destruction.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit a2b6772f1b9524b8d3c67bee3b92956d44555b22
tree a4b8b9f3675606ff935d2422e26b24adf6c1ad3c
parent 1df4e603136d09c0aee78102a05fb960be3764bb
author Patrick McHardy <kaber@trash.net> Sun, 03 Jun 2007 18:35:09 +0200
committer Patrick McHardy <kaber@trash.net> Sun, 03 Jun 2007 18:35:09 +0200

 net/sched/sch_atm.c |    1 +
 net/sched/sch_cbq.c |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index be7d299..d1c383f 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -599,6 +599,7 @@ static void atm_tc_destroy(struct Qdisc *sch)
 	/* races ? */
 	while ((flow = p->flows)) {
 		tcf_destroy_chain(flow->filter_list);
+		flow->filter_list = NULL;
 		if (flow->ref > 1)
 			printk(KERN_ERR "atm_destroy: %p->ref = %d\n",flow,
 			    flow->ref);
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index a294542..ee2d596 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1748,10 +1748,12 @@ cbq_destroy(struct Qdisc* sch)
 	 * classes from root to leafs which means that filters can still
 	 * be bound to classes which have been destroyed already. --TGR '04
 	 */
-	for (h = 0; h < 16; h++)
-		for (cl = q->classes[h]; cl; cl = cl->next)
+	for (h = 0; h < 16; h++) {
+		for (cl = q->classes[h]; cl; cl = cl->next) {
 			tcf_destroy_chain(cl->filter_list);
-
+			cl->filter_list = NULL;
+		}
+	}
 	for (h = 0; h < 16; h++) {
 		struct cbq_class *next;
 

  reply	other threads:[~2007-06-03 16:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-03 14:18 OOPS iproute2/tc/u32_destroy in 2.6.22-rc3-git6 Strobl Anton
2007-06-03 15:04 ` Michal Piotrowski
2007-06-03 15:04 ` Michal Piotrowski
2007-06-03 16:36   ` Patrick McHardy [this message]
2007-06-03 17:48     ` Strobl Anton
2007-06-03 18:05       ` Patrick McHardy

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=4662EE12.1080400@trash.net \
    --to=kaber@trash.net \
    --cc=a.strobl@aws-it.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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.