From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; dkim=pass header.d=toke.dk; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=toke.dk policy.dmarc=reject From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1764321354; bh=F+CjRqBrjC0rAcQccPgfnKMmmA7NQZelpcIoR5ArYis=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QsDUx4eiQf3NYHLRNNEzF9dhPWxQbNFAhRMn9f88igM2SH7qH6hULPNDogqOagoxQ oEWH9geuciATS5yEotIzL6aaiLSBnBjX/t4Myc4OFfPm8YjLrtZcECwxgD+IXHmuI+ dng9LELNcRnYr+tQ9ePRXkEkrEaedi0So7hP100DI2/KwuFGfXBGnyElodl87Ca2s7 rUj1U2LQSRb5jRiGK5ma0Vf/RRel41XPdDAC4ppFRVLvKSrnVPVNPyLFkpg6WRWCFj EVZJk9+mLTCSLiwV4hQBTVbQC61APOOnqPTHr6XBgbdJ41ZVJ0ocDIhVZbqxjqMOpV zDkukhREo8QCw== To: Xiang Mei , security@kernel.org Cc: netdev@vger.kernel.org, xiyou.wangcong@gmail.com, cake@lists.bufferbloat.net, bestswngs@gmail.com, Xiang Mei In-Reply-To: <20251128001415.377823-1-xmei5@asu.edu> References: <20251128001415.377823-1-xmei5@asu.edu> Date: Fri, 28 Nov 2025 10:15:53 +0100 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87ikeubjqu.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: RLXKJ4GJ3LAEZM4GFWQ74GOUCQZMIJ7J X-Message-ID-Hash: RLXKJ4GJ3LAEZM4GFWQ74GOUCQZMIJ7J X-MailFrom: toke@toke.dk X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Subject: [Cake] Re: [PATCH net v8 1/2] net/sched: sch_cake: Fix incorrect qlen reduction in cake_drop List-Id: Cake - FQ_codel the next generation Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Xiang Mei writes: > In cake_drop(), qdisc_tree_reduce_backlog() is used to update the qlen > and backlog of the qdisc hierarchy. Its caller, cake_enqueue(), assumes > that the parent qdisc will enqueue the current packet. However, this > assumption breaks when cake_enqueue() returns NET_XMIT_CN: the parent > qdisc stops enqueuing current packet, leaving the tree qlen/backlog > accounting inconsistent. This mismatch can lead to a NULL dereference > (e.g., when the parent Qdisc is qfq_qdisc). > > This patch computes the qlen/backlog delta in a more robust way by > observing the difference before and after the series of cake_drop() > calls, and then compensates the qdisc tree accounting if cake_enqueue() > returns NET_XMIT_CN. > > To ensure correct compensation when ACK thinning is enabled, a new > variable is introduced to keep qlen unchanged. > > Fixes: 15de71d06a40 ("net/sched: Make cake_enqueue return NET_XMIT_CN whe= n past buffer_limit") > Signed-off-by: Xiang Mei Please retain tags when reposting... Reviewed-by: Toke H=C3=B8iland-J=C3=B8rgensen