From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 207963161A3; Sat, 30 May 2026 17:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780161746; cv=none; b=DWDbe+sOW6vvHTcrESWR6YxXtfiJ7n/2PPXrp0jeefTr4AFlzJ3+HTgQ/JUM7OtETCrgdrxNAbVgpHjAbFcprC/E0y9/mv0yJRBXVWZXVCsETbYniOZt+Q4S09PA+Mb47RpMlKZh17edr0Qjkuwswj4zIV9vnJK8K0gBd0EaXwI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780161746; c=relaxed/simple; bh=XigeqrE9LU99mk4Duke5JeSu8PtWUqEkYjQP6jg2igs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mmB7Wm5SO2v5KxYR4tkpQ/yHjdOXch+JSaBvO0J+lBg+InMECgKl+0NOdeGi2QrEZVV5mYqJORH55hfxlSbLYlgepFP7+jXuJ+nXeWPovMokAB61ly91WbcziUWZSU52ZRw6vT1SIf+5TDPjMTdEolJYH6bpwf4v5R8zqfhV4wU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rhZJvp9m; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rhZJvp9m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 638301F00893; Sat, 30 May 2026 17:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780161745; bh=b1sOUuGCOrI0s/IOaUqrBvKeo8+jj6QfA6Gi5fHIpco=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rhZJvp9mQ+4pxwaYg5BNY1yjrPk2oc9R5kID6FzDEbMG0IyeVRA5d+6xNW9uBDqEq NXzRSVtWyuEmgi0TFMrOBTLz8Ps0ps0sM3DcXJZXBgJtIUmfZfrDUYd3RjPa4Q2ywQ Oz2Vdl2peb9U5j30JoX3mPGAZzhsDLmCXio6gZ6s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Jamal Hadi Salim , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 715/969] net/sched: sch_fq_codel: remove data-races from fq_codel_dump_stats() Date: Sat, 30 May 2026 18:03:59 +0200 Message-ID: <20260530160320.278469671@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit bbfaa73ea6871db03dc05d7f05f00557a8981f25 ] fq_codel_dump_stats() acquires the qdisc spinlock a bit too late. Move this acquisition before we fill st.qdisc_stats with live data. Fixes: edb09eb17ed8 ("net: sched: do not acquire qdisc spinlock in qdisc/class stats dump") Signed-off-by: Eric Dumazet Reviewed-by: Jamal Hadi Salim Link: https://patch.msgid.link/20260421142509.3967231-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sched/sch_fq_codel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 47b5a056165cb..056895df17854 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -568,6 +568,8 @@ static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d) }; struct list_head *pos; + sch_tree_lock(sch); + st.qdisc_stats.maxpacket = q->cstats.maxpacket; st.qdisc_stats.drop_overlimit = q->drop_overlimit; st.qdisc_stats.ecn_mark = q->cstats.ecn_mark; @@ -576,7 +578,6 @@ static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d) st.qdisc_stats.memory_usage = q->memory_usage; st.qdisc_stats.drop_overmemory = q->drop_overmemory; - sch_tree_lock(sch); list_for_each(pos, &q->new_flows) st.qdisc_stats.new_flows_len++; -- 2.53.0