Re: [REGRESSION] af_unix: Introduce SO_PASSRIGHTS - break OpenGL

From: brian . scott . sampson
Date: Tue Sep 16 2025 - 18:16:56 EST


> Thanks for the report.
>
> Could you test the diff below ?
>
> look like some programs start listen()ing before setting
> SO_PASSCRED or SO_PASSPIDFD and there's a small race window.
>
> ---8<---
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index fd6b5e17f6c4..87439d7f965d 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -1971,7 +1971,8 @@ static void unix_maybe_add_creds(struct sk_buff
> *skb, const struct sock *sk,
>   if (UNIXCB(skb).pid)
>   return;
>  
> - if (unix_may_passcred(sk) || unix_may_passcred(other)) {
> + if (unix_may_passcred(sk) || unix_may_passcred(other) ||
> +     !other->sk_socket) {
>   UNIXCB(skb).pid = get_pid(task_tgid(current));
>   current_uid_gid(&UNIXCB(skb).uid, &UNIXCB(skb).gid);
>   }
> ---8<---
Just came across this when troubleshooting a resume from suspend issue
where I'm get a black screen after suspend. Initially saw this with my
distribution's(Linux 6.16.7-2-cachyos) kernel, and confirmed the issue
in the latest version of the vanilla mainline kernel. Bisection is also
pointing to commit 3f84d577b79d2fce8221244f2509734940609ca6.

This patch appears to be already applied in the mainline kernel, so
this might be something different. I'm new to mailing lists, so wasn't
sure if I should report this issue here or start a new email chain.

--
Brian Sampson <brian.scott.sampson@xxxxxxxxx>