The IPv4 and IPv6 TCP-AO key derivation inputs each contain the
six-byte RFC 5926 label. The protocol uses all six bytes and does
not include a terminating NUL.
The kernel build currently suppresses GCC's
-Wunterminated-string-initialization warning. Enabling it flags both
label initializers. Mark the fields as __nonstring to document their
fixed width and avoid those warnings when the check is enabled.
The existing inputs are correct and their bytes do not change.
OpenAI Codex assisted with the patch, commit message, and local tests
using the public KSPP compiler diagnostics.
Link: https://github.com/KSPP/linux/issues/382
Link: https://github.com/KSPP/linux/issues/383
Signed-off-by: Anggara Putra <angg…@gmail.com>
---
v2: Explain the opt-in warning and drop the Fixes tag.
Shorten diff hunk headings to avoid line wrapping in transit.
Previous posting: https://patchwork.kernel.org/patch/15051434/
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 @@ tcp_v4_ao_calc_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 @@ tcp_v6_ao_calc_key
{
struct kdf_input_block {
u8 counter;
- u8 label[6];
+ u8 label[6] __nonstring;
struct tcp6_ao_context ctx;
__be16 outlen;
} __packed input = {
base-commit: c1165beb053a652299b1503b2dd7674ced0b1596
[PATCH net-next v2 RESEND] net: tcp: Mark TCP-AO key derivation labels as nonstrings
- From
- angg…@gmail.com (Anggara Putra)
- Organization
- Usenet Network
- Message-ID
- <CALo…@mail.gmail.com>
- Date
- Newsgroups
- linux.kernel.netdev