Article View: linux.kernel.netdev
Article #25121Re: [PATCH v2 net] net/sched: sch_qfq: bound backward slot rotation
From: Jamal Hadi Salim
Date: Tue, 01 Dec 2026 09:19
Date: Tue, 01 Dec 2026 09:19
57 lines
14324 bytes
14324 bytes
On Mon, Nov 30, 2026 at 12:22 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> 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?
>
Unfortunately the OP doesnt include how they actually created the
issue; otherwise, our test environment could have vetted it.
The code changes look sane. The sashikos are complaining about
commit/code doc (not code) which should only be fixed if there's a
respin and the only reason i can see it needing a respin is to
essentially answer how it was reproduced (which also answer your
question below).
> It's totally unclear to me how the aggregates become state and if
> the issue could/should be addressed flushing such stale entries
> earlier.
cheers,
jamal
> /P
Technical Details
Message-ID:
<CAM0EoMm=K2m4V8LmAG_nXSDNiBgn9jVfKntdMBc4JE3CbbcHBw@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374892-linux-kernel-netdev=dewy.ruReferences:
<20261124040208.13282-1-ljp1205831794@gmail.com> <7ecbb59e-d985-4b75-9240-ce83bcd87175@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374892-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v2 net] net/sched: sch_qfq: bound backward slot rotation
Date: Tue, 1 Dec 2026 04:19:03 -0500
Organization: Usenet Network
Message-ID: <CAM0EoMm=K2m4V8LmAG_nXSDNiBgn9jVfKntdMBc4JE3CbbcHBw@mail.gmail.com>
References: <20261124040208.13282-1-ljp1205831794@gmail.com> <7ecbb59e-d985-4b75-9240-ce83bcd87175@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="1672186"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:p83Fzh46q40x2bWzfWlEYE9IR+E= sha256:tFB+5GVmPZTVu4z4LyxPF7d++qjDhCD7U9ngSWfNA4Y=
sha1:NT05eDd9yadAybdC1QKHtF9CUWQ= sha256:Lm221RQs2sO/K9YCUPjeaLo3gJWU4z3hFEoQDFAAd/o=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 496121172F8; Tue, 1 Dec 2026 12:19:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
header.d=mojatatu.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id ULDAbfbQF46S;
Tue, 1 Dec 2026 12:19:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-374892-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id 4951B1172F4; Tue, 1 Dec 2026 12:19:23 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id 0BE17601E8C; Tue, 1 Dec 2026 09:19:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796116759;
b=C0S4MliXE2Y8t9QInp9EyCKAgM/wd4GB/DMk+wxd5WzndOh7/GUgf1vmF/CZ1ppmUJ3H
X1UtXobJvH1vH2Wlrp/Gx874+jvJ8LhjMSvhmBcS+8C8HKwlbEXtkZhj6Bh26kOFnHORo
lw4d5pVOkvwMrn2tlhN0/BOSbBbQatq7X2x81w5j3NgdMRP9UPPWXQczjsiwlH487eCYp
TlLDgZbhi7l4CPoEgnSdvgV2i+R5+4FDJrVAJsrsqb+761CfUXo9rz8towu3FGVFjo61M
hJofRMeNJ6PKHGUAeBHoWaV+pS/HeZZAtgI0zWC9ci8YvASUV04Kj07Wv5xjSTXBbYA==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796116759;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
References:In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:
Cc:Content-Type:Content-Transfer-Encoding;
bh=hBKq95LVHHOOK9l6w6YM0HJfs6QqPaQuDjo7PjDQqF8=;
b=ZwqDTFWYRh/+Mr89ujWwn0HV65pecDJJYGDo9f0/PRnBFRDKaWgvgyaYXSmEbESfsC56
S9zcd1OWH8L8Mfy5bSioRmiQw0dwX9Ts/VyvxaAnMOrlvUJCkejlivK8WWYaO9UGYrwWQ
S5JMIhXAq6N2AM1a1uw/lnbJdaXWb7vW1fghg1JVeFtERYPvonN6sQ8CUxHn+1spyw006
1CEVYEFg46Es7+VaUT8aQ2oYlDxew6Huv3gs5lICuM3OhisH5Z5srb/XfqC/siIc5q1EH
8VwXuMzhjmap/0uxU2VnzpZyG+/hKUR57MsCRxv0DEcNE+yEgUczdPx5Jhf3LEGzSFA==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b="a/b3H7pl";
dmarc=none header.from=mojatatu.com;
spf=none smtp.mailfrom=mojatatu.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id AB8C5606A33E;
Tue, 1 Dec 2026 09:19:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=a/b3H7pl
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.210.179
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796116758;
b=Iu+UQsXBgEteiBEROci31rQh7oLjY5k1qPHO2Bug9XrkzISIy2oJ2Aw7WXk4JMCT0KYA
B79G5FAeJufd66P0i+V0iwGh5DkEb0hJO/XOR5rIzelx3/19sNicjaBG6m9iK9BgzEztV
E0LhgwezU63VqnnHpzmSLQCBvbiHRSOU+VDv3q+mgkif0qd++24nkAlmFoAcs3s4tPGec
ijca771ILANOVXIYH9ly+vomNHhejAm2AG3vfw38H8DESezlhYFL3JwqJnE80+aBx89eC
A2IQyYk4VEvSE/IK1fvzvQz7Z8tD5s1LlLPA0t3iFX8UJotIUFI4O8Ktw5ct6ZWMMDw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796116758;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:
MIME-Version:References:In-Reply-To:From:Date:X-Gm-Features:
Message-ID:Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
bh=hBKq95LVHHOOK9l6w6YM0HJfs6QqPaQuDjo7PjDQqF8=;
b=IzI4MC6rIT2W63bTOkvLJDvTBOqgTSIhLtoL+v79/wE5CA3J0LG135q8C0WuFe9bhK4V
mGhX6h6LJfS7VFcS65cpvpr7OEkFXP/nYsW9U0o0Gf4VvwIoBT4CT5sEN0R+OxFVdSSBp
zA+OWXQVpRD/HiWHVCwDHegnX7SQYRDHMvNrV4zIr4ewZ99vTxQNTM2Anlhd5Cz7WUJz5
lJXLxE3U7HMVQALRA0tWmow4/NKQAXtkPoKf/t/sE/y9BD7HQmwUKZKumq8oOEF0BY2Ih
Jjg7b6doG3dB8GK3VvrJOVpq2MPcLtxC6qRkGoO0Ks8GXVZ+oEZQCCaTZZV6CYRKUkg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=none header.from=mojatatu.com;
spf=none smtp.mailfrom=mojatatu.com;
dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b="a/b3H7pl";
arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.210.179
X-Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 446AD606A327
for <netdev@vger.kernel.org>; Tue, 1 Dec 2026 09:19:17 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 446AD606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com
X-Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8b3577deeb0so5181194b3a.3
for <netdev@vger.kernel.org>; Tue, 01 Dec 2026 01:19:17 -0800 (PST)
X-ARC-Seal: i=1; a=rsa-sha256; t=1796116756; cv=none;
d=google.com; s=arc-20260327;
b=gBuTbC6dTpilfc3BumVfPj3Y3u9JtGZ+KVEHQILZqbMg5USVcav82AIbOwbUe90bLe
hit8f6MYGGZvhNhmIk65mHpxMYDgBFOHquc4JEcKHvrkFLCn/eCL/I3vBjcbSfAWaBNR
WRLopmmpEYcz+aoYB+NLhgJb5rsbXneKsv0y86uUvo6SDnS9ukGFeok+L8CNepgtx69R
SCjQKnArPEOsb9CBP2L/Jp2GnXk0W4VirqAHIrMOO9SJ0/M7WHQZ7cjlZHZRQC9aOuxq
W7y9JMDufRLWbMufvspO9mM1JGtqGAu30GiUmEVihboBtLOZ13dWkQeEwa1ftE1XLrH/
m98g==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:dkim-signature;
bh=hBKq95LVHHOOK9l6w6YM0HJfs6QqPaQuDjo7PjDQqF8=;
fh=2Y1IMzSphO8/ImAQctsCf6vorDuXsfi4Gcvpl6uzWhQ=;
b=RSCQjTeAx3n4aZpzT+zbrJ6j7bu1Yi24yeoN86J2hkdg5CVS2VlZ/V9lf9Qf5l8+UV
JixMwRHL+OHzAuGcMlQbJwmwE2B8Pvu6OeMeO9UT4TXvLMWXMiw6f6mF78Q20Q2Q6CBR
l7ARzm02Jcxy6KvyvqOeyjwaAAWomx06zbobHxaaoISKcI/Ku2IYpaB+5WWyWCrwmWEN
kLNV7nlTVGeyebdNRzU9mrkpJtc3FkgERPCO6QTiq3+0AbwIparN/uFtkwYKyh9lSCoY
vev3IJNQqg7BznuKQ/iLFY7+iUt7P+SdzYauaxZrRty8lH9L21tHwKs5dB0yb1URuNbx
+ngA==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=mojatatu.com; s=google; t=1796116756; x=1796721556; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=hBKq95LVHHOOK9l6w6YM0HJfs6QqPaQuDjo7PjDQqF8=;
b=a/b3H7plTZ4oqt5UxQSfea/46LpH4FLX6mhWAH7ljxVMBTMDHPJuUndByAOZ2YY1C3
8mvJ6iffolB0AUN/GztetTbZPW4LpFqAdwppz9yt98n+1ULQ9O1xYRRMR8micEtUNZR8
l+NO7E0OgciCKBuzdviDAN/fPYK2hAyA0Y8RQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796116756; x=1796721556;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=hBKq95LVHHOOK9l6w6YM0HJfs6QqPaQuDjo7PjDQqF8=;
b=D09sLxE4obQ4S2qTzvMyBZaYpC9y/djMaOBbH+cCMO4GIb2DmPZxwkrBewjoZLxMwL
koxuXCcpNYt4vN7Gbv3kb+iA9iU7QnitvpImRwFhBROm/r0vfBgN2Z3sb72jQeMlPTRf
qAlzsp5MIYKsW78IWQeshQmyvdXxGhjuPmocVWqsVJ5pJL+AP61CmBcjQwuJ95LLeKhk
caIRpN21bf1Kgj4nahNtuKdvsjJDrZA/aQx0VWoPKC0elubsnyVsPY3K/HvCqdxhSIA8
n9sUU77dmBhen3mDbnxEiiuTZMbvhswcZfXvvA3JwDMLXypd9bC3X5Ln3QuSMHh55KHo
JcyA==
X-Forwarded-Encrypted: i=1; AL+hErEXX0xTWlFGmGzKOf177J7+4ypS5K40mzbAsE3oU3HOS6+WO4QNST1Vxlgo2i4fv5rdVj+X5uY=@vger.kernel.org
X-Gm-Message-State: APuU4Z9qLeGfZDusHpJkfeO/sUjOnGn6c/7rZZxXK+wtDDL7wHZTagxf
v0TgQNANBxdZY0CD5BjWACJ6oov4EhqSUKq6aLmAmYaje21TvArSULrloIjqJimgVSKdMlZnE1Q
wI7GbjZ9Ku5QI72TcBKODya0HIsz/8HH2G1FFpyyE
X-Gm-Gg: AZFdTZeFeOZqxv4mSJ0n41o839h0BzsuJLo2Ft3u/ptweHN0u6PBbUcGOAt3Kz5UlME
vhk9MKfdxIslUEKo44sUxFye+03SqKbcDbAHqGMsuqyImV84sJrw951WsxRefSYw3u2OkRMEu+j
I2w+WLtkD9xiKVB7SG5yIMGbirD8ktChe7k+6cz/iriDAwCusBFukR8Wb/xdvimMi7xv/vCPWgf
XABhwERfF4Am86cuBnB7Eb+fp9DUhOSx54LXH63mr47E1mLN+xJaiQZFtBv+my9oWZtVBBP8REz
GAp3yzME6h1fuA0DhGmm0PAp5XaQ559CvfWfVbwaYLr7CBIlmrfIacLz60EDnFWrQ1IDZcVg/Jk
WcSptgYRS0BdUX4j8yJDv/iPLqlN5/I2ADZq6wUGOGkm/axDzRn5JuGUWiDAMo1vyaOoLM3UBtT
zU6EIn9+3OXLU9Z08j53NZ0BRAIlNVeKAzbACYukVNADpVp59RWCKZvH9hJeDcoNHMDvCnSenSY
vHoPaX9rISm+P56Laq2mzIFizGBldc=
X-Received: by 2002:a05:6a00:a908:b0:886:773d:a6a with SMTP id
d2e1a72fcca58-8c87c199463mr33383937b3a.28.1796116756335; Tue, 01 Dec 2026
01:19:16 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <7ecbb59e-d985-4b75-9240-ce83bcd87175@redhat.com>
X-Gm-Features: Aa3M54pcyAZIgfTBLgVUAqIfKNtpeaxGjmP7b1bzv2ydkHD4bnJ0TLf8RcboJec
X-Cc: jiri@resnulli.us, netdev@vger.kernel.org,
Lin Jiapeng <ljp1205831794@gmail.com>, 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