Skip to content

Commit 875765c

Browse files
pvts-matPlaidCat
authored andcommitted
net_sched: hfsc: Fix a UAF vulnerability in class with netem as child qdisc
jira VULN-68295 cve CVE-2025-37890 commit-author Victor Nogueira <[email protected]> commit 141d343 As described in Gerrard's report [1], we have a UAF case when an hfsc class has a netem child qdisc. The crux of the issue is that hfsc is assuming that checking for cl->qdisc->q.qlen == 0 guarantees that it hasn't inserted the class in the vttree or eltree (which is not true for the netem duplicate case). This patch checks the n_active class variable to make sure that the code won't insert the class in the vttree or eltree twice, catering for the reentrant case. [1] https://lore.kernel.org/netdev/CAHcdcOm+03OD2j6R0=YHKqmy=VgJ8xEOKuP6c7mSgnp-TEJJbw@mail.gmail.com/ Fixes: 37d9cf1 ("sched: Fix detection of empty queues in child qdiscs") Reported-by: Gerrard Tai <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: Victor Nogueira <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 141d343) Signed-off-by: Marcin Wcisło <[email protected]>
1 parent 883fab7 commit 875765c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/sch_hfsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)
15681568
return err;
15691569
}
15701570

1571-
if (first) {
1571+
if (first && !cl->cl_nactive) {
15721572
if (cl->cl_flags & HFSC_RSC)
15731573
init_ed(cl, len);
15741574
if (cl->cl_flags & HFSC_FSC)

0 commit comments

Comments
 (0)