Re: [patch 5/8] rslib: Split rs control struct

From: Kees Cook
Date: Wed Apr 18 2018 - 13:03:52 EST


On Wed, Apr 4, 2018 at 12:40 PM, Boris Brezillon
<boris.brezillon@xxxxxxxxxxx> wrote:
> Hi Thomas,
>
> On Wed, 28 Mar 2018 22:51:43 +0200
> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
>> The decoder library uses variable length arrays on stack. To get rid of
>> them it's it would be simple to allocate fixed length arrays on stack, but
>
> ^ s/it's//
>
>> those might become rather large. The other solution is to allocate the
>> buffers in the rs control structure, but this cannot be done as long as the
>> structure can be shared by several users. Sharing is desired because the RS
>> polynom tables are large and initialization is time consuming.
>>
>> To solve this split the codec information out of the control structure and
>> have a pointer to a shared codec in it. Instantiate the control structure
>> for each user, create a new codec if no shareable is avaiable yet. Adjust
>> all affected usage sites to the new scheme.
>>
>> This allows to add per instance decoder buffers to the control structure
>> later on.
>>
>> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>> ---
>> drivers/mtd/nand/cafe_nand.c | 7 +
>> drivers/mtd/nand/diskonchip.c | 7 +
>
> Don't know how you want to get these patches merged, but the NAND
> related changes will conflict with my nand/for-4.17 changes (NAND
> code base has been moved to drivers/mtd/nand/raw).
>
> The rest looks good,
>
> Acked-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxx>

Hi, just checking in on this series. Thomas, what's your plan for
merging this? I don't see it in -next yet.

-Kees

--
Kees Cook
Pixel Security