[PATCH v2] mtd: core: reject OOB transfers with no complete page remaining

Miquel Raynal miquel.raynal at bootlin.com
Fri Nov 20 07:02:45 PST 2026


On Thu, 05 Nov 2026 12:29:40 -0700, James Hilliard wrote:
> mtd_check_oob_ops() permits offs == mtd->size when the data length is
> zero. For an OOB-only request with a nonzero ooboffs, maxooblen then
> underflows because there are no pages remaining. The wrapped value lets
> the request pass the OOB length check.
> 
> The OOB ioctls can reach this case by encoding the OOB offset in the low
> bits of start. On a partition ending before its master device, the
> subsequent address translation allows the request to read or write OOB
> in the page immediately following the partition.
> 
> [...]

Applied to mtd/next, thanks!

[1/1] mtd: core: reject OOB transfers with no complete page remaining
      commit: 656496952b7d3b7a0283351387a2e444df07f6cc

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