From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292055; b=O0nciM6QDyb9gjczXYzXeBuIwYDIbH8mNxpV93BBKmZTyhAyNQQ0hhMLd+Bl8FFdm9bI KRvqYMpdlLnazVTG7nhms3IPaJrY4EHAhT/KoE2e+iNhlcXVeMV2TyItuZHvOyMJYbV7b Ug0kO1FOuwHt1XXXMj77Z/mS1BvZ1pxlXblwy3fqEbBBaPCVttDc+pA+JqmrroxWs3LlS UCDmPmTRI8iB3XRV1fRDXsI0CEoK6Q1874uQFcYobNYGVdGvjROlH5dgi1557BpV0P1up txK/SP+7PRtUZUBC7/bF+ImyQEsx/y4XRBPak+b3Xgs3qAui9KXkCYdp4sdaMYXbJJQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292055; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:In-Reply-To:References:User-Agent:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding: X-Last-TLS-Session-Version; bh=CQuygVLSsgiFwOF/LWi+X5d4uku9jhtDWm1G/b7OnPY=; b=CLBr5fUP/+CEmf5dPB2Bz/WW997/06MH3YItfqkAfSiZeXnk/oaOOW0KqyN13yWLh9hG Ykhz+t5xGFoOQuxLYe+PXYG3tRggok054XyXXP2bsFX+/Jt6S8XrVR+S6Q5vgcOC+FQsn E0hzbqf8MbrWKy3hODzCnl+cTK6j7+e274hXi6WAIW4KVQE3CwfihtDhIUt/6GxQZsu1v ti27yaxugaVG+8BxleEfXUhdb5OyAyGtq6jIBDpmajyQ8kgeNQMjFiXyol/q320wyzJnB cia+6LOV0/qAiSmBDzF+pmGX6bAwnp+e6lmV+OTsVGQoOyhms4bMDbxtCNZNUApoMug== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=NET5A78A; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2F86606A322; Thu, 3 Dec 2026 10:00:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E2F86606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=NET5A78A Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 59137C2AC55; Thu, 3 Dec 2026 10:01:03 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CFA6E604ED; Thu, 3 Dec 2026 10:00:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7276C11EA1F5F; Thu, 03 Dec 2026 11:00:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796292051; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=CQuygVLSsgiFwOF/LWi+X5d4uku9jhtDWm1G/b7OnPY=; b=NET5A78AxEg5qH0N6f9Rwp+1aS7xdbrnPVCOIlcsGT77vtKbj25Y08nnvIwi5DzxqO1eYO nQq6XquobGYR4Yi6f88cQMkRkbasbeBFON5M34Hyx4Tav6d8h79W+iVlbjnMmPhy7lEfZw x1vmIIdQYDWs+Y9oE6C2RoKQ3hanlB8bO5yHTBCtMnocZbmuspummzyOdxnILKFQ6GUI1q wO+la0y5fSZzkgomO9zWGHbELcJT00XoE8IyVAbGCLzU7+/FgxbAmBD0Vv+SRLuJQLf7qY DrC9vv1ZS1Gv+odiYqyvIVwM1cgesRKCxRGNSuKlztME0ZpxjJBoywLLeIuNJw== From: Miquel Raynal To: Fang Xieyan Cc: richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] mtd: mtdpart: fix overflow check for partition offset and size In-Reply-To: <20261203080547.15619-1-fangxy@xiaopeng.com> (Fang Xieyan's message of "Thu, 3 Dec 2026 16:05:47 +0800") References: <20261203080547.15619-1-fangxy@xiaopeng.com> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Thu, 03 Dec 2026 11:00:43 +0100 Message-ID: <87se0ek7jo.fsf@bootlin.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hi, On 03/12/2026 at 16:05:47 +08, Fang Xieyan wrote: > allocate_partition() checks whether a partition extends beyond its > parent by adding the partition offset and size. Both values are u64, > so the addition can overflow and wrap to a value smaller than the > parent size. The day you see an 8 Zetta bytes flash, you're gonna have many more issues than this one. MTD maintainers, shall we take this kind of over denfensive fix? The diff is minimal, so I'm not bothered by the change besides the fact that I don't think it is in any way useful. Thanks, Miqu=C3=A8l