[SRU][N/O/P][PATCH v2 1/3] net_sched: hfsc: Fix a UAF vulnerability in class with netem as child qdisc
Ian Whitfield
ian.whitfield at canonical.com
Wed Jun 4 17:48:14 UTC 2025
From: Victor Nogueira <victor at mojatatu.com>
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: 37d9cf1a3ce3 ("sched: Fix detection of empty queues in child qdiscs")
Reported-by: Gerrard Tai <gerrard.tai at starlabs.sg>
Acked-by: Jamal Hadi Salim <jhs at mojatatu.com>
Signed-off-by: Victor Nogueira <victor at mojatatu.com>
Link: https://patch.msgid.link/20250425220710.3964791-3-victor@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
(cherry picked from commit 141d34391abbb315d68556b7c67ad97885407547)
CVE-2025-37890
Signed-off-by: Ian Whitfield <ian.whitfield at canonical.com>
---
net/sched/sch_hfsc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 16c45da4036a..2bc32b8244e5 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1561,7 +1561,7 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)
return err;
}
- if (first) {
+ if (first && !cl->cl_nactive) {
if (cl->cl_flags & HFSC_RSC)
init_ed(cl, len);
if (cl->cl_flags & HFSC_FSC)
--
2.43.0
More information about the kernel-team
mailing list