Skip to content

Commit aef0e39

Browse files
net_sched: hfsc: Fix a potential UAF in hfsc_dequeue() too
jira VULN-67738 cve CVE-2025-37823 commit-author Cong Wang <xiyou.wangcong@gmail.com> commit 6ccbda4 Similarly to the previous patch, we need to safe guard hfsc_dequeue() too. But for this one, we don't have a reliable reproducer. Fixes: 1da177e ("Linux-2.6.12-rc2") Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://patch.msgid.link/20250417184732.943057-3-xiyou.wangcong@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 6ccbda4) Signed-off-by: Shreeya Patel <spatel@ciq.com>
1 parent b69844b commit aef0e39

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

net/sched/sch_hfsc.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,10 +1652,16 @@ hfsc_dequeue(struct Qdisc *sch)
16521652
if (cl->qdisc->q.qlen != 0) {
16531653
/* update ed */
16541654
next_len = qdisc_peek_len(cl->qdisc);
1655-
if (realtime)
1656-
update_ed(cl, next_len);
1657-
else
1658-
update_d(cl, next_len);
1655+
/* Check queue length again since some qdisc implementations
1656+
* (e.g., netem/codel) might empty the queue during the peek
1657+
* operation.
1658+
*/
1659+
if (cl->qdisc->q.qlen != 0) {
1660+
if (realtime)
1661+
update_ed(cl, next_len);
1662+
else
1663+
update_d(cl, next_len);
1664+
}
16591665
} else {
16601666
/* the class becomes passive */
16611667
eltree_remove(cl);

0 commit comments

Comments
 (0)