All of lore.kernel.org
 help / color / mirror / Atom feed
* [NET_SCHED]: sch_htb/sch_hfsc: fix oops in qlen_notify
@ 2007-03-27 16:28 Patrick McHardy
  2007-03-27 21:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2007-03-27 16:28 UTC (permalink / raw)
  To: David S. Miller; +Cc: Kernel Netdev Mailing List

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

Fix fallout from my qdisc endless loop fixes. I've checked
all qdiscs, these two should be the only broken ones.
The patch applies to current -git and the last -stable.


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

[NET_SCHED]: sch_htb/sch_hfsc: fix oops in qlen_notify

During both HTB and HFSC class deletion the class is removed from the
class hash before calling qdisc_tree_decrease_qlen. This makes the
->get operation in qdisc_tree_decrease_qlen fail, so it passes a NULL
pointer to ->qlen_notify, causing an oops.

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

---
commit 36ab004c1021c259b8780834287494fe630fc9ee
tree cad66b55dd7c6954ff9b55b16f791d7474adf6b0
parent 703071b5b93d88d5acb0edd5b9dd86c69ad970f2
author Patrick McHardy <kaber@trash.net> Tue, 27 Mar 2007 17:07:50 +0200
committer Patrick McHardy <kaber@trash.net> Tue, 27 Mar 2007 18:25:42 +0200

 net/sched/sch_hfsc.c |    4 +++-
 net/sched/sch_htb.c  |    6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 396deb7..407c6fb 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1184,10 +1184,12 @@ hfsc_delete_class(struct Qdisc *sch, unsigned long arg)
 
 	sch_tree_lock(sch);
 
-	list_del(&cl->hlist);
 	list_del(&cl->siblings);
 	hfsc_adjust_levels(cl->cl_parent);
+
 	hfsc_purge_queue(sch, cl);
+	list_del(&cl->hlist);
+
 	if (--cl->refcnt == 0)
 		hfsc_destroy_class(sch, cl);
 
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 97cbb9a..3c3294d 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1380,15 +1380,15 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
 
 	sch_tree_lock(sch);
 
-	/* delete from hash and active; remainder in destroy_class */
-	hlist_del_init(&cl->hlist);
-
 	if (!cl->level) {
 		qlen = cl->un.leaf.q->q.qlen;
 		qdisc_reset(cl->un.leaf.q);
 		qdisc_tree_decrease_qlen(cl->un.leaf.q, qlen);
 	}
 
+	/* delete from hash and active; remainder in destroy_class */
+	hlist_del_init(&cl->hlist);
+
 	if (cl->prio_activity)
 		htb_deactivate(q, cl);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [NET_SCHED]: sch_htb/sch_hfsc: fix oops in qlen_notify
  2007-03-27 16:28 [NET_SCHED]: sch_htb/sch_hfsc: fix oops in qlen_notify Patrick McHardy
@ 2007-03-27 21:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-03-27 21:04 UTC (permalink / raw)
  To: kaber; +Cc: netdev

From: Patrick McHardy <kaber@trash.net>
Date: Tue, 27 Mar 2007 18:28:48 +0200

> Fix fallout from my qdisc endless loop fixes. I've checked
> all qdiscs, these two should be the only broken ones.
> The patch applies to current -git and the last -stable.

Applied, thanks Patrick.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-27 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27 16:28 [NET_SCHED]: sch_htb/sch_hfsc: fix oops in qlen_notify Patrick McHardy
2007-03-27 21:04 ` David Miller

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.