[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5uN9Rr3v1uWH765@mail.google.com>
Date: Fri, 16 Dec 2022 10:13:25 +1300
From: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Kees Cook <keescook@...omium.org>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Jiri Slaby <jirislaby@...nel.org>,
Haowen Bai <baihaowen@...zu.com>, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] [next] pcmcia: synclink_cs: replace 1-element array with
flex-array member
On Thu, Dec 15, 2022 at 10:57:57AM +0200, Andy Shevchenko wrote:
> On Thu, Dec 15, 2022 at 6:29 AM Paulo Miguel Almeida
> <paulo.miguel.almeida.rodenas@...il.com> wrote:
> > On Thu, Dec 15, 2022 at 12:06:46AM +0200, Andy Shevchenko wrote:
> > > On Wed, Dec 14, 2022 at 11:49 PM Kees Cook <keescook@...omium.org> 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.
> >
> > I agree with using __packed attribute to remove the extra padding (and
> > for the reasons you mentioned before). That would reduce the sizeof(RXBUF)
> > from 8 to 5 (which is good) but that is still 1 byte "too much".
>
> What I meant with the above is that the code has to work properly with
> or without __packed. It's just to show you that this code has flaws if
> it relies on the padding.
>
Right - that would work just as well. I will work on v3 with the
suggestions given by you (sizing calculation amendments using overflow.h
macros) and kees (adding the notes regarding the padding) then.
- Paulo A.
Powered by blists - more mailing lists