Skip to content

Commit 8eb0e45

Browse files
committed
net_sched: hfsc: Fix a potential UAF in hfsc_dequeue() too
jira VULN-67737 cve CVE-2025-37823 commit-author Cong Wang <[email protected]> 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 <[email protected]> Signed-off-by: Cong Wang <[email protected]> Reviewed-by: Jamal Hadi Salim <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 6ccbda4) Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent efc8e72 commit 8eb0e45

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
@@ -1649,10 +1649,16 @@ hfsc_dequeue(struct Qdisc *sch)
16491649
if (cl->qdisc->q.qlen != 0) {
16501650
/* update ed */
16511651
next_len = qdisc_peek_len(cl->qdisc);
1652-
if (realtime)
1653-
update_ed(cl, next_len);
1654-
else
1655-
update_d(cl, next_len);
1652+
/* Check queue length again since some qdisc implementations
1653+
* (e.g., netem/codel) might empty the queue during the peek
1654+
* operation.
1655+
*/
1656+
if (cl->qdisc->q.qlen != 0) {
1657+
if (realtime)
1658+
update_ed(cl, next_len);
1659+
else
1660+
update_d(cl, next_len);
1661+
}
16561662
} else {
16571663
/* the class becomes passive */
16581664
eltree_remove(cl);

0 commit comments

Comments
 (0)