Re: [PATCH v1 1/2] pid: add pidfd_open()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Oleg Nesterov <oleg@xxxxxxxxxx>
- Subject: Re: [PATCH v1 1/2] pid: add pidfd_open()
- From: Aleksa Sarai <cyphar@xxxxxxxxxx>
- Date: Fri, 17 May 2019 01:12:02 +1000
- Cc: Christian Brauner <christian@xxxxxxxxxx>, jannh@xxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, arnd@xxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, dhowells@xxxxxxxxxx, ebiederm@xxxxxxxxxxxx, elena.reshetova@xxxxxxxxx, keescook@xxxxxxxxxxxx, luto@xxxxxxxxxxxxxx, luto@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-api@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-kselftest@xxxxxxxxxxxxxxx, joel@xxxxxxxxxxxxxxxxx, dancol@xxxxxxxxxx, serge@xxxxxxxxxx, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
- In-reply-to: <20190516150611.GC22564@redhat.com>
- References: <20190516135944.7205-1-christian@brauner.io> <20190516142659.GB22564@redhat.com> <20190516145607.j43xyj26k6l5vmbd@yavin> <20190516150611.GC22564@redhat.com>
On 2019-05-16, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> On 05/17, Aleksa Sarai wrote:
> > On 2019-05-16, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > > On 05/16, Christian Brauner wrote:
> > > > With the introduction of pidfds through CLONE_PIDFD it is possible to
> > > > created pidfds at process creation time.
> > >
> > > Now I am wondering why do we need CLONE_PIDFD, you can just do
> > >
> > > pid = fork();
> > > pidfd_open(pid);
> >
> > While the race window would be exceptionally short, there is the
> > possibility that the child will die
>
> Yes,
>
> > and their pid will be recycled
> > before you do pidfd_open().
>
> No.
>
> Unless the caller's sub-thread does wait() before pidfd_open(), of course.
> Or unless you do signal(SIGCHILD, SIG_IGN).
What about CLONE_PARENT?
--
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
Attachment:
signature.asc
Description: PGP signature
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]