All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Vagin <avagin@gmail.com>
To: Alexey Izbyshev <izbyshev@ispras.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Florian Weimer <fweimer@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Kees Cook <keescook@chromium.org>
Subject: Re: Potentially undesirable interactions between vfork() and time namespaces
Date: Wed, 7 Sep 2022 10:15:51 -0700	[thread overview]
Message-ID: <YxjRx3+MipdFOudw@gmail.com> (raw)
In-Reply-To: <da95e333b4c508ddf8130f8f2d2cbb92@ispras.ru>

On Wed, Sep 07, 2022 at 08:33:20AM +0300, Alexey Izbyshev wrote:
> > 
> > That is something to be double checked.
> > 
> > I can't see where it would make sense to unshare a time namespace and
> > then call exec, instead of calling exit.  So I suspect we can just
> > change this behavior and no one will notice.
> > 
> One can imagine a helper binary that calls unshare, forks some children in
> new namespaces, and then calls exec to hand off actual work to another
> binary (which might not expect being in the new time namespace). I'm purely
> theorizing here, however. Keeping a special case for vfork() based only on
> FUD is likely a net negative, so it'd be nice to hear actual time namespace
> users speak up, and switch to the solution you suggested if they don't care.

I can speak for one tool that uses time namespaces for the right
reasons. It is CRIU.  When a process is restored, the monotonic and
boottime clocks have to be adjusted to match old values. It is for what
the timens was designed for. These changes doesn't affect CRIU.

Honestly, I haven't heard about other users of timens yet. I don't take
into account tools like unshare.

> 
> The "unshare" tool from util-linux will also change behavior if called
> without "--fork" (e.g. "unshare --user --time"), but that would be unusual
> usage (just as for "--pid"), so most people probably don't do that (or don't
> care about the time namespace of the exec'ed process, but care only about
> its children).



  reply	other threads:[~2022-09-07 17:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 19:49 Potentially undesirable interactions between vfork() and time namespaces Alexey Izbyshev
2022-08-31  1:18 ` Andrei Vagin
2022-09-01  3:45   ` Andrei Vagin
2022-09-01  4:21     ` Florian Weimer
2022-09-01 15:49     ` Alexey Izbyshev
2022-09-01 18:11     ` Eric W. Biederman
2022-09-02 16:14       ` Andrei Vagin
2022-09-02 16:39         ` Alexey Izbyshev
2022-09-02 17:20           ` Andrei Vagin
2022-09-02 17:01       ` Alexey Izbyshev
2022-09-02 17:28         ` Andrei Vagin
2022-09-06 22:16         ` Eric W. Biederman
2022-09-07  5:33           ` Alexey Izbyshev
2022-09-07 17:15             ` Andrei Vagin [this message]
2022-09-08  8:10               ` Christian Brauner
2022-09-08 22:13                 ` Eric W. Biederman
2022-09-09  7:51                   ` Christian Brauner
2022-09-11 15:12                     ` Kees Cook
2022-09-11 22:51                       ` Andrei Vagin

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=YxjRx3+MipdFOudw@gmail.com \
    --to=avagin@gmail.com \
    --cc=0x7f454c46@gmail.com \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=fweimer@redhat.com \
    --cc=izbyshev@ispras.ru \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.