Skip to content

Commit cb0160d

Browse files
committed
net_sched: hfsc: Fix a potential UAF in hfsc_dequeue() too
jira LE-4321 cve CVE-2025-37797 Rebuild_History Non-Buildable kernel-4.18.0-553.77.1.el8_10 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 2afe456 commit cb0160d

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

0 commit comments

Comments
 (0)