Netdev List
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Willem de Bruijn <willemb@google.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/6 net-next] net: uapi: Add __kernel_sockaddr_unspec for sockaddr of unknown length
Date: Thu, 24 Jul 2025 15:28:02 -0700	[thread overview]
Message-ID: <202507241526.292798770A@keescook> (raw)
In-Reply-To: <20250724144046.36dd3611@kernel.org>

On Thu, Jul 24, 2025 at 02:40:46PM -0700, Jakub Kicinski wrote:
> On Wed, 23 Jul 2025 16:19:08 -0700 Kees Cook wrote:
> > I added this to UAPI in the hopes that it could also be used for any
> > future "arbitrarily sized" sockaddr needs. But it may be better to
> > use a different UAPI with an explicit size member:
> > 
> > struct sockaddr_unspec {
> > 	u16 sa_data_len;
> > 	u16 sa_family;
> > 	u8  sa_data[] __counted_by(sa_data_len);
> > };
> 
> Right, not sure how likely we are to add completely new future APIs 
> that take sockaddr directly. Most new interfaces will be wrapped in
> Netlink. I may be missing the point but the need to add this struct
> in uAPI right now is not obvious to me.

Yeah, it was pure speculation on my part. I am perfectly happy keeping
it strictly internal to the kernel, but I thought I'd try to show some
possibilities.

-- 
Kees Cook

  reply	other threads:[~2025-07-24 22:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 23:19 [PATCH 0/6 net-next] net: Introduce struct sockaddr_unspec Kees Cook
2025-07-23 23:19 ` [PATCH 1/6 net-next] net: uapi: Add __kernel_sockaddr_unspec for sockaddr of unknown length Kees Cook
2025-07-24 21:40   ` Jakub Kicinski
2025-07-24 22:28     ` Kees Cook [this message]
2025-07-23 23:19 ` [PATCH 2/6 net-next] net/l2tp: Add missing sa_family validation in pppol2tp_sockaddr_get_info Kees Cook
2025-07-23 23:19 ` [PATCH 3/6 net-next] net: Convert proto_ops bind() callbacks to use sockaddr_unspec Kees Cook
2025-07-24 11:29   ` kernel test robot
2025-07-24 13:31     ` Kees Cook
2025-07-24 13:02   ` kernel test robot
2025-07-23 23:19 ` [PATCH 4/6 net-next] net: Convert proto_ops connect() " Kees Cook
2025-07-24 12:00   ` kernel test robot
2025-07-23 23:19 ` [PATCH 5/6 net-next] net: Remove struct sockaddr from net.h Kees Cook
2025-07-23 23:19 ` [PATCH 6/6 net-next] net: Convert proto callbacks from sockaddr to sockaddr_unspec Kees Cook

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=202507241526.292798770A@keescook \
    --to=kees@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox