🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Henry Martin Fri, 27 Nov 2026 06:57
[PATCH net] net_sched: hfsc: clear el_node linkage in hfsc_reset_class()
#23381
Author: Henry Martin
Date: Fri, 27 Nov 2026 06:57
44 lines
12035 bytes
hfsc_reset_qdisc() drops the eligible tree root, but hfsc_reset_class()
never resets the linkage state of cl->el_node.  A class that sits in the
eligible tree at reset time keeps a stale linked node while the tree is
gone.  This breaks the invariant that the linkage state of el_node
matches the membership, which hfsc_change_class() establishes for new
classes.

Two consumers trip over the stale node.  cl_in_el_or_vttree() reads it
as "class is in the tree", so hfsc_enqueue() never calls init_ed() for
the class again and the class is starved permanently.  eltree_remove()
later runs rb_erase() on the stale node against the reset root, which
splices a stale sibling back into q->eligible.rb_node and revives a
class the scheduler should have forgotten.

Clear the linkage state where the rest of the scheduling state is
reset.

This issue was discovered by Tencent CodeBuddy Security.

Cc: stable@vger.kernel.org
Fixes: ac9fe7dd8e73 ("net_sched: hfsc: Address reentrant enqueue adding class to eltree twice")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
---
 net/sched/sch_hfsc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 284490fd6ca91..e64df06429239 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1491,6 +1491,10 @@ hfsc_reset_class(struct hfsc_class *cl)
 
 	cl->vt_tree = RB_ROOT;
 	cl->cf_tree = RB_ROOT;
+	/* hfsc_reset_qdisc() drops the eligible tree root; the
+	 * linkage state of el_node must match the membership.
+	 */
+	RB_CLEAR_NODE(&cl->el_node);
 	qdisc_reset(cl->qdisc);
 
 	if (cl->cl_flags & HFSC_RSC)
-- 
2.39.5
Re: [PATCH net] net_sched: hfsc: clear el_node linkage in hfsc_reset_class()
#23382
Author: netdev-bot+sinfo
Date: Fri, 27 Nov 2026 07:03
19 lines
8600 bytes
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads