Skip to content

Commit 61fce85

Browse files
committed
sch_ets: make est_qlen_notify() idempotent
jira VULN-71728 cve-pre CVE-2025-38107 commit-author Cong Wang <xiyou.wangcong@gmail.com> commit a7a15f3 est_qlen_notify() deletes its class from its active list with list_del() when qlen is 0, therefore, it is not idempotent and not friendly to its callers, like fq_codel_dequeue(). Let's make it idempotent to ease qdisc_tree_reduce_backlog() callers' life. Also change other list_del()'s to list_del_init() just to be extra safe. Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Link: https://patch.msgid.link/20250403211033.166059-6-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> (cherry picked from commit a7a15f3) Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
1 parent d7bc710 commit 61fce85

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/sched/sch_ets.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static void ets_class_qlen_notify(struct Qdisc *sch, unsigned long arg)
291291
* to remove them.
292292
*/
293293
if (!ets_class_is_strict(q, cl) && sch->q.qlen)
294-
list_del(&cl->alist);
294+
list_del_init(&cl->alist);
295295
}
296296

297297
static int ets_class_dump(struct Qdisc *sch, unsigned long arg,
@@ -493,7 +493,7 @@ static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch)
493493
if (unlikely(!skb))
494494
goto out;
495495
if (cl->qdisc->q.qlen == 0)
496-
list_del(&cl->alist);
496+
list_del_init(&cl->alist);
497497
return ets_qdisc_dequeue_skb(sch, skb);
498498
}
499499

@@ -667,7 +667,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
667667
}
668668
for (i = q->nbands; i < oldbands; i++) {
669669
if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
670-
list_del(&q->classes[i].alist);
670+
list_del_init(&q->classes[i].alist);
671671
qdisc_tree_flush_backlog(q->classes[i].qdisc);
672672
}
673673
q->nstrict = nstrict;
@@ -723,7 +723,7 @@ static void ets_qdisc_reset(struct Qdisc *sch)
723723

724724
for (band = q->nstrict; band < q->nbands; band++) {
725725
if (q->classes[band].qdisc->q.qlen)
726-
list_del(&q->classes[band].alist);
726+
list_del_init(&q->classes[band].alist);
727727
}
728728
for (band = 0; band < q->nbands; band++)
729729
qdisc_reset(q->classes[band].qdisc);

0 commit comments

Comments
 (0)