linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member
@ 2022-02-16 19:50 Gustavo A. R. Silva
  2022-02-16 20:35 ` Kees Cook
  2022-04-06  7:19 ` Kalle Valo
  0 siblings, 2 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2022-02-16 19:50 UTC (permalink / raw)
  To: Luca Coelho, Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva,
	linux-hardening

There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/mei/sap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mei/sap.h b/drivers/net/wireless/intel/iwlwifi/mei/sap.h
index 11e3009121cc..be1456dea484 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/sap.h
+++ b/drivers/net/wireless/intel/iwlwifi/mei/sap.h
@@ -298,7 +298,7 @@ struct iwl_sap_hdr {
 	__le16 type;
 	__le16 len;
 	__le32 seq_num;
-	u8 payload[0];
+	u8 payload[];
 };
 
 /**
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member
  2022-02-16 19:50 [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member Gustavo A. R. Silva
@ 2022-02-16 20:35 ` Kees Cook
  2022-03-26  0:41   ` Gustavo A. R. Silva
  2022-04-06  7:19 ` Kalle Valo
  1 sibling, 1 reply; 6+ messages in thread
From: Kees Cook @ 2022-02-16 20:35 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Luca Coelho, Kalle Valo, David S. Miller, Jakub Kicinski,
	linux-wireless, netdev, linux-kernel, linux-hardening

On Wed, Feb 16, 2022 at 01:50:30PM -0600, Gustavo A. R. Silva wrote:
> There is a regular need in the kernel to provide a way to declare
> having a dynamically sized set of trailing elements in a structure.
> Kernel code should always use “flexible array members”[1] for these
> cases. The older style of one-element or zero-length arrays should
> no longer be used[2].
> 
> [1] https://en.wikipedia.org/wiki/Flexible_array_member
> [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
> 
> Link: https://github.com/KSPP/linux/issues/78
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member
  2022-02-16 20:35 ` Kees Cook
@ 2022-03-26  0:41   ` Gustavo A. R. Silva
  2022-03-28  5:48     ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2022-03-26  0:41 UTC (permalink / raw)
  To: Kees Cook
  Cc: Luca Coelho, Kalle Valo, David S. Miller, Jakub Kicinski,
	linux-wireless, netdev, linux-kernel, linux-hardening

On Wed, Feb 16, 2022 at 12:35:22PM -0800, Kees Cook wrote:
> On Wed, Feb 16, 2022 at 01:50:30PM -0600, Gustavo A. R. Silva wrote:
> > There is a regular need in the kernel to provide a way to declare
> > having a dynamically sized set of trailing elements in a structure.
> > Kernel code should always use “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > [1] https://en.wikipedia.org/wiki/Flexible_array_member
> > [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
> > 
> > Link: https://github.com/KSPP/linux/issues/78
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

Hi all,

Friendly ping: can someone take this, please?

...I can take this in my -next tree in the meantime.

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member
  2022-03-26  0:41   ` Gustavo A. R. Silva
@ 2022-03-28  5:48     ` Kalle Valo
  2022-04-01  8:10       ` Coelho, Luciano
  0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2022-03-28  5:48 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Kees Cook, Luca Coelho, David S. Miller, Jakub Kicinski,
	linux-wireless, netdev, linux-kernel, linux-hardening

"Gustavo A. R. Silva" <gustavoars@kernel.org> writes:

> On Wed, Feb 16, 2022 at 12:35:22PM -0800, Kees Cook wrote:
>> On Wed, Feb 16, 2022 at 01:50:30PM -0600, Gustavo A. R. Silva wrote:
>> > There is a regular need in the kernel to provide a way to declare
>> > having a dynamically sized set of trailing elements in a structure.
>> > Kernel code should always use “flexible array members”[1] for these
>> > cases. The older style of one-element or zero-length arrays should
>> > no longer be used[2].
>> > 
>> > [1] https://en.wikipedia.org/wiki/Flexible_array_member
>> > [2]
>> > https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
>> > 
>> > Link: https://github.com/KSPP/linux/issues/78
>> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>> 
>> Reviewed-by: Kees Cook <keescook@chromium.org>
>
> Hi all,
>
> Friendly ping: can someone take this, please?
>
> ...I can take this in my -next tree in the meantime.

I'll take this. Luca, ack?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member
  2022-03-28  5:48     ` Kalle Valo
@ 2022-04-01  8:10       ` Coelho, Luciano
  0 siblings, 0 replies; 6+ messages in thread
From: Coelho, Luciano @ 2022-04-01  8:10 UTC (permalink / raw)
  To: kvalo, gustavoars
  Cc: keescook, linux-wireless, linux-kernel, davem, kuba,
	linux-hardening, netdev

On Mon, 2022-03-28 at 08:48 +0300, Kalle Valo wrote:
> "Gustavo A. R. Silva" <gustavoars@kernel.org> writes:
> 
> > On Wed, Feb 16, 2022 at 12:35:22PM -0800, Kees Cook wrote:
> > > On Wed, Feb 16, 2022 at 01:50:30PM -0600, Gustavo A. R. Silva wrote:
> > > > There is a regular need in the kernel to provide a way to declare
> > > > having a dynamically sized set of trailing elements in a structure.
> > > > Kernel code should always use “flexible array members”[1] for these
> > > > cases. The older style of one-element or zero-length arrays should
> > > > no longer be used[2].
> > > > 
> > > > [1] https://en.wikipedia.org/wiki/Flexible_array_member
> > > > [2]
> > > > https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
> > > > 
> > > > Link: https://github.com/KSPP/linux/issues/78
> > > > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> > > 
> > > Reviewed-by: Kees Cook <keescook@chromium.org>
> > 
> > Hi all,
> > 
> > Friendly ping: can someone take this, please?
> > 
> > ...I can take this in my -next tree in the meantime.
> 
> I'll take this. Luca, ack?

Acked-by: Luca Coelho <luciano.coelho@intel.com>

--
Cheers,
Luca.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member
  2022-02-16 19:50 [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member Gustavo A. R. Silva
  2022-02-16 20:35 ` Kees Cook
@ 2022-04-06  7:19 ` Kalle Valo
  1 sibling, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2022-04-06  7:19 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Luca Coelho, David S. Miller, Jakub Kicinski, linux-wireless,
	netdev, linux-kernel, Gustavo A. R. Silva, linux-hardening

"Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:

> There is a regular need in the kernel to provide a way to declare
> having a dynamically sized set of trailing elements in a structure.
> Kernel code should always use “flexible array members”[1] for these
> cases. The older style of one-element or zero-length arrays should
> no longer be used[2].
> 
> [1] https://en.wikipedia.org/wiki/Flexible_array_member
> [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
> 
> Link: https://github.com/KSPP/linux/issues/78
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> Reviewed-by: Kees Cook <keescook@chromium.org>
> Acked-by: Luca Coelho <luciano.coelho@intel.com>

Patch applied to wireless-next.git, thanks.

c5f675748cf0 iwlwifi: mei: Replace zero-length array with flexible-array member

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220216195030.GA904170@embeddedor/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-06 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 19:50 [PATCH][next] iwlwifi: mei: Replace zero-length array with flexible-array member Gustavo A. R. Silva
2022-02-16 20:35 ` Kees Cook
2022-03-26  0:41   ` Gustavo A. R. Silva
2022-03-28  5:48     ` Kalle Valo
2022-04-01  8:10       ` Coelho, Luciano
2022-04-06  7:19 ` Kalle Valo

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).