The TCP-AO key derivation input contains the six bytes of the RFC 5926 label. Mark both fixed-width fields as __nonstring so GCC can distinguish them from unterminated C strings. The serialized input and its length stay the same for both address families. OpenAI Codex assisted with the patch, commit message, and local tests using the public KSPP compiler diagnostics. Fixes: 068f5a009556 ("net/tcp-ao: Use crypto library API instead of crypto_ahash") Link: https://github.com/KSPP/linux/issues/382 Link: https://github.com/KSPP/linux/issues/383 Signed-off-by: Anggara Putra --- The IPv4 and IPv6 TCP-AO objects matched their pre-patch x86-64 builds byte for byte. The connect, self-connect and key-management kselftests passed for both address families in QEMU. net/ipv4/tcp_ao.c | 2 +- net/ipv6/tcp_ao.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_ao.c b/net/ipv4/tcp_ao.c index 857b868..ecf397f 100644 --- a/net/ipv4/tcp_ao.c +++ b/net/ipv4/tcp_ao.c @@ -445,7 +445,7 @@ static void tcp_v4_ao_calc_key(struct tcp_ao_key *mkt, u8 *key, /* See RFC5926 3.1.1 */ struct kdf_input_block { u8 counter; - u8 label[6]; + u8 label[6] __nonstring; struct tcp4_ao_context ctx; __be16 outlen; } __packed input = { diff --git a/net/ipv6/tcp_ao.c b/net/ipv6/tcp_ao.c index 01a8472..e448ea3 100644 --- a/net/ipv6/tcp_ao.c +++ b/net/ipv6/tcp_ao.c @@ -20,7 +20,7 @@ static void tcp_v6_ao_calc_key(struct tcp_ao_key *mkt, u8 *key, { struct kdf_input_block { u8 counter; - u8 label[6]; + u8 label[6] __nonstring; struct tcp6_ao_context ctx; __be16 outlen; } __packed input = {