From: Jakub Kicinski <kuba@kernel.org>
To: Kees Cook <kees@kernel.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH RFC 0/5] sockaddr usage removal
Date: Tue, 5 Nov 2024 17:16:07 -0800 [thread overview]
Message-ID: <20241105171607.48c0c24d@kernel.org> (raw)
In-Reply-To: <20241104221450.work.053-kees@kernel.org>
On Mon, 4 Nov 2024 14:25:02 -0800 Kees Cook wrote:
> I think for getname() (and similar interfaces) we *do* want to use
> sockaddr_storage, but there is kind of an argument to instead use
> a struct with a flexible array, e.g.:
>
> struct sockaddr_unspec {
> sa_family_t sa_family;
> char sa_data[];
> };
>
> If this was done, then all these APIs would switch their casts from
> "(struct sockaddr *)" to "(struct sockaddr_unspec *)", even though in
> most cases the object is actully a struct sockaddr_storage.
struct sockaddr_unspec was my knee-jerk reaction but looking at the code
- indeed passing struct sockaddr_storage seems cleaner.
> What do folks think?
Looks nice, and feels like the right direction :)
FWIW if the conversion work is too tedious I think I can find some
people that could help.
prev parent reply other threads:[~2024-11-06 1:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 22:25 [PATCH RFC 0/5] sockaddr usage removal Kees Cook
2024-11-04 22:25 ` [PATCH RFC 1/5] Revert "net: dev: Convert sa_data to flexible array in struct sockaddr" Kees Cook
2024-11-04 22:25 ` [PATCH RFC 2/5] net: core: dev.c confirmed to use classic sockaddr Kees Cook
2024-11-04 22:25 ` [PATCH RFC 3/5] rtnetlink: do_setlink: Use sockaddr_storage Kees Cook
2024-11-05 10:59 ` Eric Dumazet
2024-12-17 1:52 ` Kees Cook
2024-11-04 22:25 ` [PATCH RFC 4/5] net: core: Convert inet_addr_is_any() to sockaddr_storage Kees Cook
2024-11-04 22:25 ` [PATCH RFC 5/5] net: Convert proto_ops::getname " Kees Cook
2024-11-06 1:16 ` 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=20241105171607.48c0c24d@kernel.org \
--to=kuba@kernel.org \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).