]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net/sched: qfq: Use cl_is_active to determine whether class is active in qfq_rm_from_ag
authorJamal Hadi Salim <jhs@mojatatu.com>
Wed, 14 Jan 2026 16:02:42 +0000 (11:02 -0500)
committerJakub Kicinski <kuba@kernel.org>
Mon, 19 Jan 2026 20:06:41 +0000 (12:06 -0800)
This is more of a preventive patch to make the code more consistent and
to prevent possible exploits that employ child qlen manipulations on qfq.
use cl_is_active instead of relying on the child qdisc's qlen to determine
class activation.

Fixes: 462dbc9101acd ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost")
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20260114160243.913069-3-jhs@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_qfq.c

index 9d59090bbe934ad56ab08a59708aab375aa77cf0..e7778413e72fea65d0558105384d36925d5c28ca 100644 (file)
@@ -373,7 +373,7 @@ static void qfq_rm_from_agg(struct qfq_sched *q, struct qfq_class *cl)
 /* Deschedule class and remove it from its parent aggregate. */
 static void qfq_deact_rm_from_agg(struct qfq_sched *q, struct qfq_class *cl)
 {
-       if (cl->qdisc->q.qlen > 0) /* class is active */
+       if (cl_is_active(cl)) /* class is active */
                qfq_deactivate_class(q, cl);
 
        qfq_rm_from_agg(q, cl);