netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	kernel test robot <lkp@intel.com>,
	Oleksij Rempel <linux@rempel-privat.de>,
	Sean Anderson <sean.anderson@seco.com>,
	Alexandru Tachici <alexandru.tachici@analog.com>,
	Amit Cohen <amcohen@nvidia.com>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3] ethtool: Replace 0-length array with flexible array
Date: Fri, 6 Jan 2023 12:07:39 -0800	[thread overview]
Message-ID: <202301061206.30BA940F83@keescook> (raw)
In-Reply-To: <CAMZ6RqKyvGwh7iOVvtONGYA21==Lj6p9JECstCBFSWRRCPAVZQ@mail.gmail.com>

On Fri, Jan 06, 2023 at 02:38:18PM +0900, Vincent MAILHOL wrote:
> On Fri. 6 Jan 2023 at 13:28, Kees Cook <keescook@chromium.org> wrote:
> > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
> 
> Side comment, this link does not mention the __DECLARE_FLEX_ARRAY().
> It could be good to add a reference to the helper here. But of course,
> this is not a criticism of this patch.

Good point! I've sent a patch for this now.

> You may want to double check your other patches as well. At least this
> one is also using the helper when not needed:
> 
>   https://lore.kernel.org/netdev/20230105223642.never.980-kees@kernel.org/T/#u

That one does, actually, need it since otherwise the flex array would be
"alone in a struct" which is the other case that C99 irrationally
disallows.

-Kees

-- 
Kees Cook

  reply	other threads:[~2023-01-06 20:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06  4:28 [PATCH v3] ethtool: Replace 0-length array with flexible array Kees Cook
2023-01-06  5:38 ` Vincent MAILHOL
2023-01-06 20:07   ` Kees Cook [this message]
2023-01-06  5:47 ` Vincent MAILHOL
2023-01-06  6:25   ` Kees Cook
2023-01-06 13:19 ` Jann Horn
2023-01-06 14:25   ` Vincent MAILHOL
2023-01-06 20:13     ` minimum compiler for Linux UAPI (was Re: [PATCH v3] ethtool: Replace 0-length array with flexible array) Kees Cook
2023-01-06 20:58       ` Arnd Bergmann
2023-01-06 16:25 ` [PATCH v3] ethtool: Replace 0-length array with flexible array Gustavo A. R. Silva
2023-01-07  3:40 ` patchwork-bot+netdevbpf

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=202301061206.30BA940F83@keescook \
    --to=keescook@chromium.org \
    --cc=alexandru.tachici@analog.com \
    --cc=amcohen@nvidia.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=gustavoars@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=lkp@intel.com \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=sean.anderson@seco.com \
    /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;
as well as URLs for NNTP newsgroup(s).