Skip to content

Commit 110406c

Browse files
committed
net_sched: hfsc: Fix a potential UAF in hfsc_dequeue() too
jira LE-4076 cve CVE-2025-37823 Rebuild_History Non-Buildable kernel-6.12.0-55.30.1.el10_0 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: Jonathan Maple <[email protected]>
1 parent 18afa2a commit 110406c

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

0 commit comments

Comments
 (0)