[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#276476: pppd left in D state whit QOS enabled



reassign 276476 kernel-source-2.6.8
severity 276476 important
reassign 275059 kernel-source-2.6.8
merge 276476 275059
quit

Thanks,

This appears to be a duplicte of 275059 so I am merging it with that
bug.

On Thu, Oct 14, 2004 at 03:16:46PM +0200, Ghozlane Toumi wrote:
> Package: kernel-image-2.6.8-1-386
> Version: 2.6.8-3 
> 
> Hi .
> 
> "unregister_netdevice: waiting for ppp0 to become free. Usage count = 1"
> 
> I'm having a truckload of these messages when my ppp connection dies and
> I try to relaunch it.
> ifconfig ppp0 hangs in D state, pppd too.
> 
> I'm using QOS (wondershaper) with cqb qdisc, and apparently, this is
> the culprit.
> after a quick search, it seems cqb doesn't update refcount on unload.
> There is a patch that seems to solve the problem :
> 
> http://marc.theaimsgroup.com/?l=linux-kernel&m=109317866203856&w=2

This patch seems to have been merged upstream.
I have attached what is upstream as cbq_memleak.patch,
can you please verify that it resolves your problem?

I also notice a few other seemingly important changes to this code have
been made recently:

http://linux.bkbits.net:8080/linux-2.4/related/net/sched/sch_cbq.c

In particular a fix for slab corruption which I have attached as
slab_corruption.patch. If you could put that into a build and test
it at the same time I would be most grateful.

Thanks

-- 
Horms
#ChangeSet1.1803.123.42
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/22 21:32:31-07:00 kaber@trash.net 
#   [PKT_SCHED]: Fix class leak in CBQ scheduler.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_cbq.c
#   2004/08/22 21:32:15-07:00 kaber@trash.net +8 -6
#   [PKT_SCHED]: Fix class leak in CBQ scheduler.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
--- a/net/sched/sch_cbq.c	2004-10-21 00:55:22 -07:00
+++ b/net/sched/sch_cbq.c	2004-10-21 00:55:22 -07:00
@@ -1746,15 +1746,18 @@
 	}
 }
 
-static void cbq_destroy_class(struct cbq_class *cl)
+static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl)
 {
+	struct cbq_sched_data *q = qdisc_priv(sch);
+
 	cbq_destroy_filters(cl);
 	qdisc_destroy(cl->q);
 	qdisc_put_rtab(cl->R_tab);
 #ifdef CONFIG_NET_ESTIMATOR
 	qdisc_kill_estimator(&cl->stats);
 #endif
-	kfree(cl);
+	if (cl != &q->link)
+		kfree(cl);
 }
 
 static void
@@ -1777,8 +1780,7 @@
 
 		for (cl = q->classes[h]; cl; cl = next) {
 			next = cl->next;
-			if (cl != &q->link)
-				cbq_destroy_class(cl);
+			cbq_destroy_class(sch, cl);
 		}
 	}
 
@@ -1799,7 +1801,7 @@
 		spin_unlock_bh(&sch->dev->queue_lock);
 #endif
 
-		cbq_destroy_class(cl);
+		cbq_destroy_class(sch, cl);
 	}
 }
 
@@ -2035,7 +2037,7 @@
 	sch_tree_unlock(sch);
 
 	if (--cl->refcnt == 0)
-		cbq_destroy_class(cl);
+		cbq_destroy_class(sch, cl);
 
 	return 0;
 }
#ChangeSet1.1921
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/09/16 13:13:12-07:00 tgraf@suug.ch 
#   [PKT_SCHED]: Fix slab corruption in cbq_destroy
#   
#   Fixes slab corruption in cbq_destroy. cbq_destroy_filters and
#   qdisc_put_rtab(q->link.R_tab) are already called in cbq_destroy_class.
#   The latter lead to a slab corruption due to repeated freeing of
#   q->link.R_tab because q->link is part of q->classes. Problem introduced
#   in 1.21.
#   
#   Signed-off-by: Thomas Graf <tgraf@suug.ch>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@davemloft.net>
# 
# net/sched/sch_cbq.c
#   2004/09/16 13:12:54-07:00 tgraf@suug.ch +0 -6
#   [PKT_SCHED]: Fix slab corruption in cbq_destroy
#   
#   Fixes slab corruption in cbq_destroy. cbq_destroy_filters and
#   qdisc_put_rtab(q->link.R_tab) are already called in cbq_destroy_class.
#   The latter lead to a slab corruption due to repeated freeing of
#   q->link.R_tab because q->link is part of q->classes. Problem introduced
#   in 1.21.
#   
#   Signed-off-by: Thomas Graf <tgraf@suug.ch>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@davemloft.net>
# 
diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
--- a/net/sched/sch_cbq.c	2004-10-21 00:56:01 -07:00
+++ b/net/sched/sch_cbq.c	2004-10-21 00:56:01 -07:00
@@ -1770,10 +1770,6 @@
 #ifdef CONFIG_NET_CLS_POLICE
 	q->rx_class = NULL;
 #endif
-	for (h = 0; h < 16; h++) {
-		for (cl = q->classes[h]; cl; cl = cl->next)
-			cbq_destroy_filters(cl);
-	}
 
 	for (h = 0; h < 16; h++) {
 		struct cbq_class *next;
@@ -1783,8 +1779,6 @@
 			cbq_destroy_class(sch, cl);
 		}
 	}
-
-	qdisc_put_rtab(q->link.R_tab);
 }
 
 static void cbq_put(struct Qdisc *sch, unsigned long arg)

Reply to: