Re: [PATCH] mtd: mtdpart: fix overflow check for partition offset and size
From: Miquel Raynal
Date: Thu Dec 03 2026 - 05:00:59 EST
Hi,
On 03/12/2026 at 16:05:47 +08, Fang Xieyan <fangxy@xxxxxxxxxxxx> 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èl