mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <christian.brauner@ubuntu.com>
To: Pavel Emelianov <xemul@virtuozzo.com>, Oleg Nesterov <oleg@redhat.com>
Cc: Adrian Reber <areber@redhat.com>,
	Eric Biederman <ebiederm@xmission.com>,
	Jann Horn <jannh@google.com>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Andrei Vagin (C)" <avagin@gmail.com>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Radostin Stoyanov <rstoyanov1@gmail.com>
Subject: Re: [PATCH v6 1/2] fork: extend clone3() to support setting a PID
Date: Wed, 14 Aug 2019 12:04:03 +0200	[thread overview]
Message-ID: <20190814100402.jf5p2wsqngeuazaj@wittgenstein> (raw)
In-Reply-To: <6a65c4c4-6860-b042-a0bf-b3f8e9b277af@virtuozzo.com> <20190813143023.GC6971@redhat.com>

On Wed, Aug 14, 2019 at 09:50:03AM +0000, Pavel Emelianov wrote:
> On 8/12/19 11:09 PM, Adrian Reber wrote:
> > The main motivation to add set_tid to clone3() is CRIU.
> > 
> > To restore a process with the same PID/TID CRIU currently uses
> > /proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to
> > ns_last_pid and then (quickly) does a clone(). This works most of the
> > time, but it is racy. It is also slow as it requires multiple syscalls.
> > 
> > Extending clone3() to support set_tid makes it possible restore a
> > process using CRIU without accessing /proc/sys/kernel/ns_last_pid and
> > race free (as long as the desired PID/TID is available).
> > 
> > This clone3() extension places the same restrictions (CAP_SYS_ADMIN)
> > on clone3() with set_tid as they are currently in place for ns_last_pid.
> > 
> > Signed-off-by: Adrian Reber <areber@redhat.com>
> 
> Acked-by: Pavel Emelyanov <xemul@openvz.org>

On Tue, Aug 13, 2019 at 04:30:24PM +0200, Oleg Nesterov wrote:
> On 08/12, Adrian Reber wrote:
> >
> > The main motivation to add set_tid to clone3() is CRIU.
> >
> > To restore a process with the same PID/TID CRIU currently uses
> > /proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to
> > ns_last_pid and then (quickly) does a clone(). This works most of the
> > time, but it is racy. It is also slow as it requires multiple syscalls.
> >
> > Extending clone3() to support set_tid makes it possible restore a
> > process using CRIU without accessing /proc/sys/kernel/ns_last_pid and
> > race free (as long as the desired PID/TID is available).
> >
> > This clone3() extension places the same restrictions (CAP_SYS_ADMIN)
> > on clone3() with set_tid as they are currently in place for ns_last_pid.
> >
> > Signed-off-by: Adrian Reber <areber@redhat.com>
> 
> Reviewed-by: Oleg Nesterov <oleg@redhat.com>
> 

Added-to:
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/log/?h=pidfd

Merged-into:
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/log/?h=for-next

Thanks!
Christian

  reply	other threads:[~2019-08-14 10:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 20:09 Adrian Reber
2019-08-12 20:09 ` [PATCH v6 2/2] selftests: add tests for clone3() Adrian Reber
2019-08-13 14:46   ` Christian Brauner
2019-08-13 16:14     ` Christian Brauner
2019-08-12 20:43 ` [PATCH v6 1/2] fork: extend clone3() to support setting a PID Andrei Vagin
2019-08-12 21:02   ` Adrian Reber
2019-08-12 21:50     ` Christian Brauner
2019-08-12 21:53     ` Andrei Vagin
2019-08-13  9:45 ` Christian Brauner
2019-08-13 14:30 ` Oleg Nesterov
2019-08-14 10:04   ` Christian Brauner [this message]
2019-08-14  9:50 ` Pavel Emelianov

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=20190814100402.jf5p2wsqngeuazaj@wittgenstein \
    --to=christian.brauner@ubuntu.com \
    --cc=0x7f454c46@gmail.com \
    --cc=areber@redhat.com \
    --cc=avagin@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=rppt@linux.ibm.com \
    --cc=rstoyanov1@gmail.com \
    --cc=xemul@virtuozzo.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

all inboxes | Powered by JetHome®