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 5F49A309EF2; Sat, 12 Sep 2026 15:18:04 +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=1789226285; cv=none; b=rKOYwaReV7hh3Hyq8Gt5+x1zVVB5AUharC8KZRx5V89KR5ht9quUyOdLVxKu6JWJySIHyXPFlcHIg2waSJpfXoy7eNQhVuIg9XlYR6lFMbhekX/1L9LISwSUIY2XyS3sfodnBVIcKsK3A+Xchvd1zYGJebTDN8/+EOi6pgVo5mo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789226285; c=relaxed/simple; bh=iV8GQUuYJBpyjZEngOaMSvyhlO1X4VXT07oyOCdojfI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pZID3FWnALv9TscPS87kfDIPIqCoEfEsQx+6wylJ6Bjd0BHHcdjFncuSouqVVd2k2o8wl5jT9flpWjgs/zuxjaUyXWAghdMCYQ3QdM96v8KKQeqQ6zqn88pXC6SUCKww0FjcMyrYhO9LYMxvviHS0r9lopEiiCQ8nhMlGeIE4OU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GvO0fYq4; 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="GvO0fYq4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBFBA1F000FF; Sat, 12 Sep 2026 15:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789226284; bh=sdr3BOxI1DX/r6PqrzALGFUWKd34Y4fnWsJl302eokQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GvO0fYq4stIWV9cEYi6+SrO7UTBRz8GMKmujPd0qbIw4KujqZ5SRop/pb2ZDJMN3f UgtwyTB6a0MUISN4RtxbTWfLrD7aMghRxk8/J/PK/WPkybDWMzkK0G1v6r08kw4iZj OvZURilaPeAy/VKsfeIhoyTHwgx/28GMGbXNzmMA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, vega@nebusec.ai, Victor Nogueira , Jamal Hadi Salim , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 1364/1424] net/sched: fq_pie: clamp default quantum to avoid signed overflow Date: Sat, 12 Sep 2026 09:03:16 +0200 Message-ID: <20260912065637.808154974@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jamal Hadi Salim [ Upstream commit c86cd7ed0b0e44779a3d1683f03e4353baf4bdc9 ] fq_pie_init() sets q->quantum = psched_mtu(qdisc_dev(sch)) without clamping. A device with a huge MTU (e.g. dummy with max_mtu == 0 accepting MTU 2147483634) makes psched_mtu() return 0x80000000, which overflows the signed flow->deficit to INT_MIN in fq_pie_qdisc_dequeue(), causing an infinite loop and soft lockup. Emulate fq_pie_policy which is already bounded to [1, 1 << 20]; clamp the default to [256, 1 << 20]. 256 matches fq_codel's floor and is a sane minimum for a DRR quantum. Conditions to recreate the bug: a device whose MTU (plus hard_header_len) wraps psched_mtu() into the sign bit (e.g. a dummy device with max_mtu == 0 accepting MTU 2147483634). Requires CAP_NET_ADMIN in a user namespace. Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler") Reported-by: vega@nebusec.ai Tested-by: Victor Nogueira Signed-off-by: Jamal Hadi Salim Link: https://patch.msgid.link/20260822195509.112717-5-jhs@mojatatu.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/sched/sch_fq_pie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sched/sch_fq_pie.c b/net/sched/sch_fq_pie.c index 4bd5ca9acc53f..fc57b1daa235a 100644 --- a/net/sched/sch_fq_pie.c +++ b/net/sched/sch_fq_pie.c @@ -416,7 +416,8 @@ static int fq_pie_init(struct Qdisc *sch, struct nlattr *opt, pie_params_init(&q->p_params); sch->limit = 10 * 1024; q->p_params.limit = sch->limit; - q->quantum = psched_mtu(qdisc_dev(sch)); + q->quantum = clamp_t(u32, psched_mtu(qdisc_dev(sch)), + 256, 1 << 20); q->sch = sch; q->ecn_prob = 10; q->flows_cnt = 1024; -- 2.53.0