Re: [PATCH net-next 2/3] net: add SO_PASSCRED_THREAD to get a thread-specific SCM_CREDENTIALS

From: Paolo Abeni

Date: Tue Nov 10 2026 - 05:06:11 EST


On 11/3/26 00:12, Andrew Halaney wrote:
diff --git a/net/core/sock.c b/net/core/sock.c
index e7405be8941f..6b443bd44581 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1586,6 +1586,13 @@ int sk_setsockopt(struct sock *sk, int level, int optname,
ret = -EOPNOTSUPP;
break;
+ case SO_PASSCRED_THREAD:
+ if (sk_is_unix(sk))
+ sk->sk_scm_credentials_thread = valbool;
+ else
+ ret = -EOPNOTSUPP;
+ break;

AF_UNIX supports custom setsockopt since commit
de1c489b57c11fabc766aeb6777ed5b0038fa3bb

I think it would be better to move add the af unix specific ones
into net/unix/af_unix.c.

But that is IMHO more suited for a follow-up; the series LGTM,
thanks.

Paolo