From: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Kees Cook" <keescook@chromium.org>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Haowen Bai" <baihaowen@meizu.com>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] [next] pcmcia: synclink_cs: replace 1-element array with flex-array member
Date: Fri, 16 Dec 2022 10:13:25 +1300 [thread overview]
Message-ID: <Y5uN9Rr3v1uWH765@mail.google.com> (raw)
In-Reply-To: <CAHp75VcSnRPfmk9gAgz+hb7VYtL5buzDi_1e53u8b8+PrtxAvQ@mail.gmail.com>
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@gmail.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@chromium.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.
next prev parent reply other threads:[~2022-12-15 21:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 8:42 [PATCH] [next] pcmcia: synclink_cs: replace 1-element array with flex-array member Paulo Miguel Almeida
2022-12-14 8:58 ` [PATCH v2] " Paulo Miguel Almeida
2022-12-14 10:43 ` Andy Shevchenko
2022-12-14 20:19 ` Paulo Miguel Almeida
2022-12-14 19:29 ` [PATCH] " Kees Cook
2022-12-14 20:09 ` Paulo Miguel Almeida
2022-12-14 20:26 ` Kees Cook
2022-12-14 20:39 ` Andy Shevchenko
2022-12-14 21:49 ` Kees Cook
2022-12-14 22:06 ` Andy Shevchenko
2022-12-15 4:29 ` Paulo Miguel Almeida
2022-12-15 6:35 ` Paulo Miguel Almeida
2022-12-15 8:57 ` Andy Shevchenko
2022-12-15 21:13 ` Paulo Miguel Almeida [this message]
2022-12-16 22:59 ` [PATCH v3] " Paulo Miguel Almeida
2022-12-16 23:42 ` Kees Cook
2022-12-17 0:11 ` Paulo Miguel Almeida
2022-12-17 11:43 ` Andy Shevchenko
2022-12-17 20:05 ` Paulo Miguel Almeida
2022-12-14 20:14 ` [PATCH] " Paulo Miguel Almeida
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5uN9Rr3v1uWH765@mail.google.com \
--to=paulo.miguel.almeida.rodenas@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=arnd@arndb.de \
--cc=baihaowen@meizu.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox