[PATCH] mtd: spinand: set request type explicitly in spinand_{is,mark}bad() functions
Gabor Juhos
j4g8y7 at gmail.com
Wed Nov 18 23:34:37 PST 2026
Hi Miquèl,
2026. 11. 18. 9:45 keltezéssel, Miquel Raynal írta:
> Hi Gabor,
>
> On 17/11/2026 at 16:27:11 GMT, sashiko-bot at kernel.org wrote:
>
<...>
>> [Severity: Critical]
>> This problem wasn't introduced by this patch, but can the 2-byte marker[]
>> read in spinand_isbad() [1] collide with free OOB space on chips that
>> reserve only 1 byte for the bad block marker?
>>
>> spinand_isbad() treats a block as bad whenever marker[0] != 0xff ||
>> marker[1] != 0xff, reading OOB offsets 0 and 1. However, several vendor
>> ooblayout_free() callbacks expose OOB offset 1 as free space:
>>
>> drivers/mtd/nand/spi/gigadevice.c:gd5fxgq4xa_ooblayout_free() {
>
> The bug is in the gigadevice driver. It was arbtrarily decided to keep
> using 2 bytes BBM like in the raw NAND world.
>
> You may fix this driver in a separate patch, but that is not a
> prerequisite for me.
Ok.
> However, why is this not stable material?
Sorry, I forgot to add the stable tag. Will send a v2 with the tag added.
Regards,
Gabor
More information about the linux-mtd
mailing list