From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; spf=pass smtp.mailfrom=; dkim=pass header.d=gmail.com; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=gmail.com policy.dmarc=quarantine Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by mail.toke.dk (Postfix) with ESMTPS id E11B99D54F1 for ; Thu, 27 Nov 2025 19:21:41 +0100 (CET) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-298250d7769so7826275ad.0 for ; Thu, 27 Nov 2025 10:21:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764267699; x=1764872499; darn=lists.bufferbloat.net; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=S832dEXRRuljnsRC8l5OHuN+DNSJW8AFtuJhBdXtnKQ=; b=d0KIpwpVjTfWZMXz40UoReLATti9zykeIBT/U0uTqVmJfyCj3ln15i2jfh/8mExmzj y9NXRskFpWEH6LCL75lMEkND2NyoItOAXRW6w6NLdYgCiQvrj0D9Rw1q/EukqVDP8A2K fO7GYlHsBJqxIuPIJD1nKaAygxeTzRrOVs7hMaFASDPOek+dyXWKo1/4IrrBai65DW0z CJ89jC8lMuK1wDH4EYzy0wF9JnEY3I8URRXtJLiO9+unBpkH9lAuLn2xdKLGjk3G8X1q RkcmopRHkgFvkj7kFa7H4uZYecP1ggrkvIXYEA8bZBz9xischS/Z4e7fBpNeyzsBu9Kg TDUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764267699; x=1764872499; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S832dEXRRuljnsRC8l5OHuN+DNSJW8AFtuJhBdXtnKQ=; b=hB10z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Vr/mxY0n+SqNV37TuiRIhfMDvknz5AL9lBvrVetHKItz/kUdW0miXU+pEjIjEpFDdWQ== X-Received: by 2002:a17:903:2c06:b0:290:94ed:184c with SMTP id d9443c01a7336-29b6c3e86acmr242338025ad.15.1764267698678; Thu, 27 Nov 2025 10:21:38 -0800 (PST) Received: from localhost ([2601:647:6802:dbc0:ef22:445e:1e79:6b9a]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-be508b06867sm2467380a12.23.2025.11.27.10.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Nov 2025 10:21:38 -0800 (PST) Date: Thu, 27 Nov 2025 10:21:36 -0800 From: Cong Wang To: Xiang Mei Cc: security@kernel.org, netdev@vger.kernel.org, toke@toke.dk, cake@lists.bufferbloat.net, bestswngs@gmail.com Message-ID: References: <20251126194513.3984722-1-xmei5@asu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251126194513.3984722-1-xmei5@asu.edu> Message-ID-Hash: VOUS4GMSML645JVTIF7U2L5UULLLCARV X-Message-ID-Hash: VOUS4GMSML645JVTIF7U2L5UULLLCARV X-MailFrom: xiyou.wangcong@gmail.com 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 v7 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: On Wed, Nov 26, 2025 at 12:45:12PM -0700, Xiang Mei wrote: > 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 when past buffer_limit") > Signed-off-by: Xiang Mei Acked-by: Cong Wang Thanks for your patience!