Subject: RE: [PATCH v1 net 1/2] af_unix: Fix fortify_panic() in unix_bind_bsd().

From: Kees Cook <[email-masked]>
Date: Wed, 19 Jul 2023 15:34:33 -0700

On July 19, 2023 3:26:35 PM PDT, Willem de Bruijn <[email-masked]> wrote:
>Kuniyuki Iwashima wrote:
>The extensive comments are really helpful to understand what's
>going on.
>
>An alternative would be to just cast sunaddr to a struct
>sockaddr_storage *ss and use that both here and in unix_mkname_bsd?
>It's not immediately trivial that the caller has always actually
>allocated one of those. But the rest becomes self documenting.

I would much prefer the internal APIs actually passed around the true sockaddr_storage pointer. This is what I did recently for NFS, for example:
https://git.kernel.org/linus/cf0d7e7f4520

-Kees

-- 
Kees Cook