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 3AB363515CB; Sat, 12 Sep 2026 11:26:15 +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=1789212380; cv=none; b=bYGMaMRDRkiSvsC+lHSTot+3l5riuza0BYECD0i9KD/XtswzbSE1R2tFEz+y4d2IZmbph9TiNbFQ0iFhTMjaJvCyW2ZCnumyI+XIvMhEPK5t2UY/hAQotEaNHfI89CpdsVhT10X1BnlQQL0TJrPoe7JdLetRlhDGo9ymiR0Trfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789212380; c=relaxed/simple; bh=lKmzGSPbuIktxNL/ucVfHrFKHQBoTcYiF7kzyuSY2/M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HXwxGpzrdARlyoDqcLpkHKlHw8vuc6kHPPh5V4BfJmjTkE7VaSf4RK2Sqw5lYHLLDjeFrstkOAmuSk5tprE7KWMDYWojeX13iuHt1O7dEBdcSeZFePXG3CYgtg2XLZUq4gYQqpKQ+8mkGgMaRGfia0dOXoomwlhegyofHoWyOps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gCbSVEKW; 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="gCbSVEKW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BC441F000FF; Sat, 12 Sep 2026 11:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789212371; bh=2KSB5GhRDpywryteUdXwJZrmxGHURGuw1EelmduBMGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gCbSVEKW7bo7e4tYcAHXaqvYuFTZShILfKWHhmsvQBECnSnMfzzGfIpAVBJ6Rkz1J UndCnhWwTOkPH7VzKWDT/wZ8uwi5/zFyjB1qzjDK6OqyAj0SdhgeCju8bcWOVBwzcJ tvGz6qByjq/pP0cb8FYgkw77vYxkbgeA19I93j+g= 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.18 1421/1518] net/sched: fq_pie: clamp default quantum to avoid signed overflow Date: Sat, 12 Sep 2026 08:59:50 +0200 Message-ID: <20260912065655.696688523@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@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.18-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 0c7b2095f8655..4b829d894af1c 100644 --- a/net/sched/sch_fq_pie.c +++ b/net/sched/sch_fq_pie.c @@ -427,7 +427,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