Re: [PATCH net-next v6 1/4] net: af_unix: enable custom setsockopt for all socket types
Kuniyuki Iwashima <[email protected]> Tue, 4 Aug 2026 09:49:52 -0700
| Newsgroups | gmane.linux.network,gmane.linux.file-systems,gmane.linux.kernel |
|---|---|
| Message-ID | <CAAVpQUAW4eTfvNGaY+9gD06Jct6tgM3LRYdLEVFG+VzhCFYojw@mail.gmail.com> |
On Sun, Aug 2, 2026 at 8:11=E2=80=AFAM Jori Koolstra <[email protected]> = wrote: > > unix_setsockopt() and the SOCK_CUSTOM_SOCKOPT flag were only wired up > for SOCK_STREAM (introduced along with the stream-only SO_INQ). > Consequently custom AF_UNIX options are unreachable on SOCK_DGRAM and > SOCK_SEQPACKET: those setsockopt() calls bypass unix_setsockopt() and > fall through to the generic sock_setsockopt(), failing with > -ENOPROTOOPT. > > Set SOCK_CUSTOM_SOCKOPT for every AF_UNIX socket type in unix_create(), a= nd > also for accepted sockets in unix_accept() (reachable for stream and > seqpacket). > > This is a prerequisite for making SO_RIGHTS_NOTRUNC settable on all AF_UN= IX > socket types. > > Signed-off-by: Jori Koolstra <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]>