Re: [PATCH] net/unix: pass pidfd flags via SCM_PIDFD cmsg

2024-11-14 Thread stsp
14.11.2024 05:50, Kuniyuki Iwashima пишет: From: Stas Sergeev Date: Thu, 14 Nov 2024 00:02:05 +0300 @@ -154,7 +157,12 @@ static __inline__ void scm_pidfd_recv(struct msghdr *msg, struct scm_cookie *scm if (!scm->pid) return; - pidfd = pidfd_prepare(scm->pid, 0, &pidf

Re: [PATCH] net/unix: pass pidfd flags via SCM_PIDFD cmsg

2024-11-13 Thread Kuniyuki Iwashima
From: Stas Sergeev Date: Thu, 14 Nov 2024 00:02:05 +0300 > @@ -154,7 +157,12 @@ static __inline__ void scm_pidfd_recv(struct msghdr > *msg, struct scm_cookie *scm > if (!scm->pid) > return; > > - pidfd = pidfd_prepare(scm->pid, 0, &pidfd_file); > + err = pidfd_valida

[PATCH] net/unix: pass pidfd flags via SCM_PIDFD cmsg

2024-11-13 Thread Stas Sergeev
Currently SCM_PIDFD cmsg cannot be sent via unix socket (returns -EINVAL) and SO_PASSPIDFD doesn't support flags. The created pidfd always has flags set to 0. This patch implements SCM_PIDFD cmsg in AF_UNIX socket, which can be used to send flags to SO_PASSPIDFD-enabled recipient. Self-test is ad