[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r1egpym5.fsf@keithp.com>
Date: Wed, 25 Aug 2021 22:24:18 -0700
From: Keith Packard <keithp@...thp.com>
To: Kees Cook <keescook@...omium.org>, linux-kernel@...r.kernel.org
Cc: Kees Cook <keescook@...omium.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Nilesh Javali <njavali@...vell.com>,
Manish Rangankar <mrangankar@...vell.com>,
GR-QLogic-Storage-Upstream@...vell.com,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Johannes Berg <johannes@...solutions.net>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Fabio Aiuto <fabioaiuto83@...il.com>,
Ross Schmidt <ross.schm.dev@...il.com>,
Marco Cesati <marcocesati@...il.com>,
ath10k@...ts.infradead.org, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-staging@...ts.linux.dev,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Dan Williams <dan.j.williams@...el.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
clang-built-linux@...glegroups.com, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2 3/5] treewide: Replace 0-element memcpy()
destinations with flexible arrays
Kees Cook <keescook@...omium.org> writes:
> In some cases, use of the flex_array() helper is needed when a flexible
> array is part of a union.
The code below seems to show that the helper is also needed when the
flexible array is the only member of a struct? Or is this just an
extension of the 'part of a union' clause?
> @@ -160,7 +160,7 @@ struct bmi_cmd {
>
> union bmi_resp {
> struct {
> - u8 payload[0];
> + DECLARE_FLEX_ARRAY(u8, payload);
> } read_mem;
> struct {
> __le32 result;
--
-keith
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists