[PATCH v3 1/2] mtd: rawnand: ingenic: validate BCH error index in jz4725b_correct()

Miquel Raynal miquel.raynal at bootlin.com
Thu Nov 19 04:37:18 PST 2026


On Wed, 18 Nov 2026 10:07:50 +0800, Guanglei Zhu wrote:
> The JZ4725B BCH controller reports each corrected bit error as an
> index into the codeword it was asked to decode, in the INDEX0/INDEX1
> fields of the BCH_BHERR registers. These fields are 13 bits wide, but
> nothing in jz4725b_correct() checks the reported index against the
> size of the data buffer being corrected:
> 
>     buf[(bit >> 3)] ^= BIT(bit & 0x7);
> 
> [...]

Applied to nand/next, thanks!

[1/2] mtd: rawnand: ingenic: validate BCH error index in jz4725b_correct()
      commit: 5c621482debe642623ff974dc6beff7015371fc7
[2/2] mtd: rawnand: ingenic: validate BCH error index in jz4780_correct()
      commit: 21cb873a01c5706b443b6d8328c57de8ce07cffc

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