From: Paolo Abeni <pabeni@redhat.com>
To: jhs@mojatatu.com, jiri@resnulli.us, netdev@vger.kernel.org,
Lin Jiapeng <ljp1205831794@gmail.com>
Cc: Lin Jiapeng <jiapenglin@tencent.com>,
TencentOS Corvus AI <corvus@tencent.com>,
kuba@kernel.org, davem@davemloft.net, edumazet@kernel.org,
paolo.valente@unimore.it, linux-kernel@vger.kernel.org,
horms@kernel.org
Subject: Re: [PATCH v2 net] net/sched: sch_qfq: bound backward slot rotation
Date: Mon, 30 Nov 2026 18:22:06 +0100 [thread overview]
Message-ID: <7ecbb59e-d985-4b75-9240-ce83bcd87175@redhat.com> (raw)
In-Reply-To: <20261124040208.13282-1-ljp1205831794@gmail.com>
On 11/24/26 05:01, Lin Jiapeng wrote:
> From: Lin Jiapeng <jiapenglin@tencent.com>
>
> 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@tencent.com>
> Link: https://lore.kernel.org/all/20261116121710.77403-1-ljp1205831794@gmail.com/
> Signed-off-by: Lin Jiapeng <jiapenglin@tencent.com>
@Jamal: could you please have a look?
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
prev parent reply other threads:[~2026-11-30 17:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 4:01 Lin Jiapeng
2026-11-30 17:22 ` Paolo Abeni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7ecbb59e-d985-4b75-9240-ce83bcd87175@redhat.com \
--to=pabeni@redhat.com \
--cc=corvus@tencent.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiapenglin@tencent.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ljp1205831794@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=paolo.valente@unimore.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®