Re: [PATCH v2 net] net/sched: sch_qfq: bound backward slot rotation
From: Paolo Abeni
Date: Mon Nov 30 2026 - 12:22:37 EST
On 11/24/26 05:01, Lin Jiapeng wrote:
From: Lin Jiapeng <jiapenglin@xxxxxxxxxxx>@Jamal: could you please have a look?
QFQ+ keeps aggregates in timestamp-ordered slots and rotates the
occupied-slot bitmap when a group's start time decreases, avoiding the
need to move the aggregates themselves. Insertions are capped so that
occupied slots leave room for a later backward adjustment.
A stale aggregate can make the decrease larger than the slots can
represent. Rotation can then drop occupied bits or alias distinct logical
slots onto one physical hlist, and a later removal can clear bits in the
following slot-list pointers or leave stale bits. KASAN reports a
slab-use-after-free read of size 8 in qfq_choose_next_agg+0xd04/0xd90 by
task repro/92 after the corrupted group is selected, followed by a panic.
Limit backward rotation using the highest occupied bit so every occupied
offset remains below QFQ_MAX_SLOTS. If the decrease exceeds that limit,
move the activating aggregate's S/F and rounded start time forward by the
same slot-aligned delta before rotating. This preserves its service
interval and the logical-to-physical slot mapping, including repeated
rotations, while leaving representable rotations unchanged.
Fixes: 462dbc9101ac ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost")
Reported-by: TencentOS Corvus AI <corvus@xxxxxxxxxxx>
Link: https://lore.kernel.org/all/20261116121710.77403-1-ljp1205831794@xxxxxxxxx/
Signed-off-by: Lin Jiapeng <jiapenglin@xxxxxxxxxxx>
It's totally unclear to me how the aggregates become state and if
the issue could/should be addressed flushing such stale entries
earlier.
/P