[PATCH v2 RESEND] mtd: afs: validate v2 image info bounds

Miquel Raynal miquel.raynal at bootlin.com
Fri Jul 17 08:50:41 PDT 2026


On Wed, 08 Jul 2026 09:49:06 +0800, Pengpeng Hou wrote:
> The AFS v2 parser uses footer[8] to locate the image information block
> inside the current erase block, then uses the image information
> region_count to walk entries from a fixed local array. The footer offset
> and region count come from flash contents and are not checked against the
> erase block or the local image-info array before use.
> 
> Reject v2 entries whose image information offset would underflow the
> erase block calculation, and reject region counts that cannot fit in the
> local image-info array before walking region entries.
> 
> [...]

Applied to mtd/next, thanks!

[1/1] mtd: afs: validate v2 image info bounds
      commit: e9290031f736e99ad17c25c00311c92c266843b7

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




More information about the linux-mtd mailing list