Skip to contentSkip to conversation

Fixes slab corruption in cbq_destroy

PATCH In review Thomas Graf 2 participants 2 messages Sep 16, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes slab corruption in cbq_destroy

Backport of 2.6 patch:

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.

net/sched/sch_cbq.c +0 -5
@@ -1736,10 +1736,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;
@@ -1750,7 +1746,6 @@
 		}
 	}
 
-	qdisc_put_rtab(q->link.R_tab);
 	MOD_DEC_USE_COUNT;
 }