Re: [PATCH] [next] pcmcia: synclink_cs: replace 1-element array with flex-array member

From: Andy Shevchenko
Date: Wed Dec 14 2022 - 17:07:29 EST


On Wed, Dec 14, 2022 at 11:49 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> On Wed, Dec 14, 2022 at 10:39:52PM +0200, Andy Shevchenko wrote:
> > Yes, and Try to make it work with __packed. As I said, the problem is
> > that the code is relying on something which is architecture dependent
> > strictly speaking. And hence I disagree with Kees that v2 is okay to
> > go.
>
> I meant that v2 is functionally identical to the existing code.

Ah, sorry for misunderstanding.

> > The full change should be something like
> >
> > check_add(sizeof(), max_frame_size)
> > kcalloc(8, size)
>
> Right -- this would fix the existing mistakes in size calculation (and
> is certainly better).

Glad to hear that we are on the same page.

--
With Best Regards,
Andy Shevchenko