Re: [PATCH] mtd: rawnand: nandsim: validate overridesize before shifting
From: Miquel Raynal
Date: Fri Nov 20 2026 - 10:07:26 EST
On Sun, 08 Nov 2026 14:01:38 -0700, James Hilliard wrote:
> The size overflow check shifts by overridesize before validating it, so
> values at least 64 already cause an invalid shift. Smaller values can
> pass that check but exceed the width of the later eraseblock-count shift.
>
> Use check_shl_overflow() to calculate the unsigned eraseblock count and
> reject values that cannot be represented. Derive the byte size by
> multiplying the two 32-bit quantities in 64-bit arithmetic.
>
> [...]
Applied to nand/next, thanks!
[1/1] mtd: rawnand: nandsim: validate overridesize before shifting
commit: 388cc8f9c51163e849ac9d749800e0435db76e51
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl