From: Jakub Kicinski <kuba@kernel.org>
To: Kees Cook <kees@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemb@google.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [net-next PATCH v4 0/7] net: Introduce struct sockaddr_unsized
Date: Fri, 31 Oct 2025 17:07:19 -0700 [thread overview]
Message-ID: <20251031170719.65fb8163@kernel.org> (raw)
In-Reply-To: <20251029214355.work.602-kees@kernel.org>
On Wed, 29 Oct 2025 14:43:57 -0700 Kees Cook wrote:
> The historically fixed-size struct sockaddr is part of UAPI and embedded
> in many existing structures. The kernel uses struct sockaddr extensively
> within the kernel to represent arbitrarily sized sockaddr structures,
> which caused problems with the compiler's ability to determine object
> sizes correctly. The "temporary" solution was to make sockaddr explicitly
> use a flexible array, but this causes problems for embedding struct
> sockaddr in structures, where once again the compiler has to guess about
> the size of such objects, and causes thousands of warnings under the
> coming -Wflex-array-member-not-at-end warning.
>
> Switching to sockaddr_storage internally everywhere wastes a lot of memory,
> so we are left with needing two changes:
> - introduction of an explicitly arbitrarily sized sockaddr struct
> - switch struct sockaddr back to being fixed size
>
> Doing the latter step requires all "arbitrarily sized" uses of struct
> sockaddr to be replaced with the new struct from the first step.
>
> So, introduce the new struct and do enough conversions that we can
> switch sockaddr back to a fixed-size sa_data.
This doesn't apply to net-next.. Now I kinda wondering if maybe you
skipped a patch? The code itself LGTM.
prev parent reply other threads:[~2025-11-01 0:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 21:43 [net-next PATCH v4 0/7] net: Introduce struct sockaddr_unsized Kees Cook
2025-10-29 21:43 ` [net-next PATCH v4 1/7] net: Convert proto_ops bind() callbacks to use sockaddr_unsized Kees Cook
2025-11-01 0:05 ` Jakub Kicinski
2025-11-01 5:11 ` Kees Cook
2025-10-29 21:43 ` [net-next PATCH v4 2/7] net: Convert proto_ops connect() " Kees Cook
2025-10-29 21:44 ` [net-next PATCH v4 3/7] net: Remove struct sockaddr from net.h Kees Cook
2025-10-29 21:44 ` [net-next PATCH v4 4/7] net: Convert proto callbacks from sockaddr to sockaddr_unsized Kees Cook
2025-10-29 21:44 ` [net-next PATCH v4 5/7] bpf: Convert cgroup sockaddr filters to use sockaddr_unsized consistently Kees Cook
2025-10-29 21:44 ` [net-next PATCH v4 6/7] bpf: Convert bpf_sock_addr_kern "uaddr" to sockaddr_unsized Kees Cook
2025-10-29 21:44 ` [net-next PATCH v4 7/7] net: Convert struct sockaddr to fixed-size "sa_data[14]" Kees Cook
2025-11-01 0:07 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251031170719.65fb8163@kernel.org \
--to=kuba@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavo@embeddedor.com \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kees@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.