mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: "Serge E. Hallyn" <serge.hallyn@canonical.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	James Morris <jmorris@namei.org>,
	Kees Cook <kees.cook@canonical.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: + userns-add-a-user_namespace-as-creator-owner-of-uts_namespace.patch added to -mm tree
Date: Sun, 20 Feb 2011 22:28:53 +0000	[thread overview]
Message-ID: <20110220222853.GA2960@mail.hallyn.com> (raw)
In-Reply-To: <20110219165409.GA2712@redhat.com>

Quoting Oleg Nesterov (oleg@redhat.com):
> > Subject: userns: add a user_namespace as creator/owner of uts_namespace
> > From: "Serge E. Hallyn" <serge@hallyn.com>
> 
> Minor nit... feel free to ignore, but can't resist.
> 
> --- a/kernel/nsproxy.c~userns-add-a-user_namespace-as-creator-owner-of-uts_namespace
> +++ a/kernel/nsproxy.c
> @@ -74,6 +74,11 @@ static struct nsproxy *create_new_namesp
>  		err = PTR_ERR(new_nsp->uts_ns);
>  		goto out_uts;
>  	}
> +	if (new_nsp->uts_ns != tsk->nsproxy->uts_ns) {
> +		put_user_ns(new_nsp->uts_ns->user_ns);
> +		new_nsp->uts_ns->user_ns = task_cred_xxx(tsk, user)->user_ns;
> +		get_user_ns(new_nsp->uts_ns->user_ns);
> +	}
> 
> Looks correct, but confusing imho.
> 
> "new_nsp->uts_ns != tsk->nsproxy->uts_ns" is a bit strange way to
> check "flags & CLONE_NEWUTS", no?
> 
> And since copy_utsname() already checks CLONE_NEWUTS, can't we move
> this code into copy_utsname() or clone_uts_ns() ?

Yup.  I had only found the bug this addresses very late so sort of
felt I should keep it as an obvious band-aid for now.  I've got a
lot of feedback to address on this set (!), and I'll do this more
cleanly as well.

Thanks for taking a look, Oleg.

-serge

      reply	other threads:[~2011-02-20 22:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-19 16:54 Oleg Nesterov
2011-02-20 22:28 ` Serge E. Hallyn [this message]

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=20110220222853.GA2960@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=jmorris@namei.org \
    --cc=kees.cook@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=oleg@redhat.com \
    --cc=serge.hallyn@canonical.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

Powered by JetHome