Skip to contentSkip to conversation

sctp: Replace zero-length array with flexible array member

PATCH RESEND In review Thorsten Blum 3 participants 4 messages Feb 19, 2025 – Feb 21, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 sctp: Replace zero-length array with flexible array member

Replace the deprecated zero-length array with a modern flexible array member in the struct sctp_idatahdr.

---
 include/linux/sctp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sctp.h +1 -1
index 836a7e200f39..19eaaf3948ed 100644
@@ -239,7 +239,7 @@ struct sctp_idatahdr {
 		__u32 ppid;
 		__be32 fsn;
 	};
-	__u8 payload[0];
+	__u8 payload[];
 };
 
 struct sctp_idata_chunk {
Signature · 1 line
2.48.1
#1 lore raw
Quoted 6 lines · Thorsten Blum

Replace the deprecated zero-length array with a modern flexible array member in the struct sctp_idatahdr.

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

Quoted 20 lines
---
 include/linux/sctp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sctp.h +1 -1
index 836a7e200f39..19eaaf3948ed 100644
@@ -239,7 +239,7 @@ struct sctp_idatahdr {
 		__u32 ppid;
 		__be32 fsn;
 	};
-	__u8 payload[0];
+	__u8 payload[];
 };
 
 struct sctp_idata_chunk {
Signature · 1 line
2.48.1
Signature · 1 line
Kees Cook
maintainer
#2 lore raw
Quoted 4 lines · On Wed, 19 Feb 2025 18:24:36 -0800 Kees Cook wrote:
Quoted 3 lines · Thorsten Blum

Replace the deprecated zero-length array with a modern flexible array member in the struct sctp_idatahdr.

Quoted 8 lines
Quoted 3 lines

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! :)

maintainer
#3 lore raw
In reply to Thorsten Blum
Quoted 15 lines · 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.

---
 include/linux/sctp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sctp.h +0 -0
index 836a7e200f39..19eaaf3948ed 100644

include/linux/sctp.h struct sctp_idatahdr { · line 245

Quoted 8 lines
include/linux/sctp.h +1 -1
@@ -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.

Signature · 1 line
pw-bot: cr