diff mbox series

[RESEND] sctp: Replace zero-length array with flexible array member

Message ID 20250219112637.4319-1-thorsten.blum@linux.dev (mailing list archive)
State Changes Requested
Headers show
Series [RESEND] sctp: Replace zero-length array with flexible array member | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Thorsten Blum Feb. 19, 2025, 11:26 a.m. UTC
Replace the deprecated zero-length array with a modern flexible array
member in the struct sctp_idatahdr.

Link: https://github.com/KSPP/linux/issues/78
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 include/linux/sctp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kees Cook Feb. 20, 2025, 2:24 a.m. UTC | #1
On Wed, Feb 19, 2025 at 12:26:36PM +0100, Thorsten Blum wrote:
> Replace the deprecated zero-length array with a modern flexible array
> member in the struct sctp_idatahdr.
> 
> Link: https://github.com/KSPP/linux/issues/78
> Reviewed-by: Kees Cook <kees@kernel.org>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

I assume this will be picked up by netdev. I see 2 sctp patches pending
on patchwork:

https://patchwork.kernel.org/project/netdevbpf/list/?series=&submitter=&state=&q=sctp&archive=&delegate=

-Kees

> ---
>  include/linux/sctp.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/sctp.h b/include/linux/sctp.h
> index 836a7e200f39..19eaaf3948ed 100644
> --- a/include/linux/sctp.h
> +++ b/include/linux/sctp.h
> @@ -239,7 +239,7 @@ struct sctp_idatahdr {
>  		__u32 ppid;
>  		__be32 fsn;
>  	};
> -	__u8 payload[0];
> +	__u8 payload[];
>  };
>  
>  struct sctp_idata_chunk {
> -- 
> 2.48.1
>
Jakub Kicinski Feb. 21, 2025, 1:30 a.m. UTC | #2
On Wed, 19 Feb 2025 18:24:36 -0800 Kees Cook wrote:
> On Wed, Feb 19, 2025 at 12:26:36PM +0100, Thorsten Blum wrote:
> > Replace the deprecated zero-length array with a modern flexible array
> > member in the struct sctp_idatahdr.
> > 
> > Link: https://github.com/KSPP/linux/issues/78
> > Reviewed-by: Kees Cook <kees@kernel.org>
> > Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>  
> 
> I assume this will be picked up by netdev. I see 2 sctp patches pending
> on patchwork:
> 
> https://patchwork.kernel.org/project/netdevbpf/list/?series=&submitter=&state=&q=sctp&archive=&delegate=

TIL patchwork supports q= 
Thanks! :)
Jakub Kicinski Feb. 21, 2025, 1:33 a.m. UTC | #3
On Wed, 19 Feb 2025 12:26:36 +0100 Thorsten Blum wrote:
> Replace the deprecated zero-length array with a modern flexible array
> member in the struct sctp_idatahdr.
> 
> Link: https://github.com/KSPP/linux/issues/78
> Reviewed-by: Kees Cook <kees@kernel.org>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  include/linux/sctp.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/sctp.h b/include/linux/sctp.h
> index 836a7e200f39..19eaaf3948ed 100644
> --- a/include/linux/sctp.h
> +++ b/include/linux/sctp.h
> @@ -239,7 +239,7 @@ struct sctp_idatahdr {
>  		__u32 ppid;
>  		__be32 fsn;
>  	};
> -	__u8 payload[0];
> +	__u8 payload[];
>  };
>  
>  struct sctp_idata_chunk {

Builds for me with this field completely delete...
I think we should prefer deleting when possible.
diff mbox series

Patch

diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 836a7e200f39..19eaaf3948ed 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -239,7 +239,7 @@  struct sctp_idatahdr {
 		__u32 ppid;
 		__be32 fsn;
 	};
-	__u8 payload[0];
+	__u8 payload[];
 };
 
 struct sctp_idata_chunk {