From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <stsp2@yandex.ru>
Cc: <almasrymina@google.com>, <asml.silence@gmail.com>,
<axboe@kernel.dk>, <brauner@kernel.org>, <davem@davemloft.net>,
<edumazet@google.com>, <gouhao@uniontech.com>, <horms@kernel.org>,
<kees@kernel.org>, <krisman@suse.de>, <kuba@kernel.org>,
<kuniyu@amazon.com>, <linux-kernel@vger.kernel.org>,
<linux-kselftest@vger.kernel.org>, <mhal@rbox.co>,
<netdev@vger.kernel.org>, <oleg@redhat.com>, <pabeni@redhat.com>,
<quic_abchauha@quicinc.com>, <shuah@kernel.org>,
<tandersen@netflix.com>, <viro@zeniv.linux.org.uk>,
<willemb@google.com>
Subject: Re: [PATCH] net/unix: pass pidfd flags via SCM_PIDFD cmsg
Date: Wed, 13 Nov 2024 18:50:07 -0800 [thread overview]
Message-ID: <20241114025007.99331-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20241113210206.3440784-1-stsp2@yandex.ru>
From: Stas Sergeev <stsp2@yandex.ru>
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_validate_flags(scm->pidfd_flags);
No neede to double check here, it's already checked in __scm_send().
> + if (err) {
> + msg->msg_flags |= MSG_CTRUNC;
> + return;
> + }
> + pidfd = pidfd_prepare(scm->pid, scm->pidfd_flags, &pidfd_file);
>
> if (put_cmsg(msg, SOL_SOCKET, SCM_PIDFD, sizeof(int), &pidfd)) {
> if (pidfd_file) {
next prev parent reply other threads:[~2024-11-14 2:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 21:02 [PATCH] net/unix: pass pidfd flags via SCM_PIDFD cmsg Stas Sergeev
2024-11-14 2:50 ` Kuniyuki Iwashima [this message]
2024-11-14 9:21 ` stsp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241114025007.99331-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=almasrymina@google.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gouhao@uniontech.com \
--cc=horms@kernel.org \
--cc=kees@kernel.org \
--cc=krisman@suse.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mhal@rbox.co \
--cc=netdev@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.com \
--cc=shuah@kernel.org \
--cc=stsp2@yandex.ru \
--cc=tandersen@netflix.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox