summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2025-06-22 21:54:03 -0700
committerNamhyung Kim <namhyung@kernel.org>2025-06-22 21:54:03 -0700
commitc833e8cc4dca7e3c0a9d0b9047a1b4822b229262 (patch)
tree7cfd4ca423884505425e7f473b280ba392fb6b7c /net/unix/af_unix.c
parentedf2cadf01e8f2620af25b337d15ebc584911b46 (diff)
parent86731a2a651e58953fc949573895f2fa6d456841 (diff)
Merge tag 'v6.16-rc3' into perf-tools-next
To get the fixes in libbpf and perf tools. Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 2e2e9997a68e..22e170fb5dda 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);
}