linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Christian Brauner <christian@brauner.io>
Cc: torvalds@linux-foundation.org, viro@zeniv.linux.org.uk,
	jannh@google.com, dhowells@redhat.com, linux-api@vger.kernel.org,
	linux-kernel@vger.kernel.org, serge@hallyn.com, luto@kernel.org,
	arnd@arndb.de, ebiederm@xmission.com, keescook@chromium.org,
	tglx@linutronix.de, mtk.manpages@gmail.com,
	akpm@linux-foundation.org, cyphar@cyphar.com,
	joel@joelfernandes.org, dancol@google.com
Subject: Re: [PATCH v1 3/4] signal: support CLONE_PIDFD with pidfd_send_signal
Date: Wed, 17 Apr 2019 17:20:55 +0200	[thread overview]
Message-ID: <20190417152055.GJ32622@redhat.com> (raw)
In-Reply-To: <20190417141144.k2kmg7hd7pdpywyw@brauner.io>

On 04/17, Christian Brauner wrote:
>
> On Wed, Apr 17, 2019 at 04:01:06PM +0200, Oleg Nesterov wrote:
> > On 04/16, Christian Brauner wrote:
> > >
> > > @@ -3581,12 +3588,12 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig,
> > >  	if (flags)
> > >  		return -EINVAL;
> > >
> > > -	f = fdget_raw(pidfd);
> > > +	f = fdget(pidfd);
> >
> > could you explain this change?
> >
> > I am just curious, I don't understand why should we disallow O_PATH and how
> > this connects to this patch.
>
> Sending a signal through a pidfd is considered to be on a par with a
> "write" to that pidfd.

OK, but how this connects to "support pidfds" ?

> Additionally, we use the fops associated with the fd to detect whether
> it is actually a pidfd or not. This is not possible with O_PATH since
> f_ops will be set to dummy fops.

indeed... I didn't know this, thanks!

But this means that pidfd_send_signal() will return -EBADF with or without
this change; pidfd_to_pid() will return -EBADF even if fdget_raw() suceeds,
right?

To clarify, I am not arguing. I am trying to understand why exactly do we
need this s/fdget_raw/fdget/ change and, why it doesn't come as a separate
patch. Can you add a note into the changelog?

Oleg.


  reply	other threads:[~2019-04-17 15:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 17:02 [PATCH v1 0/4] clone: add CLONE_PIDFD Christian Brauner
2019-04-16 17:02 ` [PATCH v1 1/4] Make anon_inodes unconditional Christian Brauner
2019-04-16 17:02 ` [PATCH v1 2/4] clone: add CLONE_PIDFD Christian Brauner
2019-04-17 14:22   ` Oleg Nesterov
2019-04-17 14:25     ` Christian Brauner
2019-04-17 14:28       ` Christian Brauner
2019-04-18  9:36     ` Christian Brauner
2019-04-16 17:02 ` [PATCH v1 3/4] signal: support CLONE_PIDFD with pidfd_send_signal Christian Brauner
2019-04-17 14:01   ` Oleg Nesterov
2019-04-17 14:11     ` Christian Brauner
2019-04-17 15:20       ` Oleg Nesterov [this message]
2019-04-17 15:36         ` Christian Brauner
2019-04-16 17:02 ` [PATCH v1 4/4] samples: show race-free pidfd metadata access Christian Brauner

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=20190417152055.GJ32622@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=christian@brauner.io \
    --cc=cyphar@cyphar.com \
    --cc=dancol@google.com \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=jannh@google.com \
    --cc=joel@joelfernandes.org \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=serge@hallyn.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).