public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge.hallyn@canonical.com>
To: Nathan Lynch <ntl@pobox.com>
Cc: containers@lists.linux-foundation.org,
	kernel list <linux-kernel@vger.kernel.org>,
	dhowells@redhat.com, LSM <linux-security-module@vger.kernel.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH 09/10] userns: check user namespace for task->file uid equivalence checks
Date: Tue, 1 Mar 2011 17:07:29 -0600	[thread overview]
Message-ID: <20110301230729.GA28694@hallyn.com> (raw)
In-Reply-To: <1299018281.461.16.camel@tp-t61>

Quoting Nathan Lynch (ntl@pobox.com):
> On Thu, 2011-02-24 at 15:03 +0000, Serge E. Hallyn wrote:
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -1446,8 +1446,13 @@ enum {
> >  #define put_fs_excl() atomic_dec(&current->fs_excl)
> >  #define has_fs_excl() atomic_read(&current->fs_excl)
> >  
> > -#define is_owner_or_cap(inode)	\
> > -	((current_fsuid() == (inode)->i_uid) || capable(CAP_FOWNER))
> > +/*
> > + * until VFS tracks user namespaces for inodes, just make all files
> > + * belong to init_user_ns
> > + */
> > +extern struct user_namespace init_user_ns;
> 
> init_user_ns gets declared in fs.h in this patch, utsname.h in patch #1,
> capability.h in #2, ipc_namespace.h in #7.  Could this declaration be
> kept to a single header?
> 

ipc/msgutil.c includes security.h which includes fs.h, so we should be
able to drop the one in ipc_namespace.h.  The one in utsname.h is
there for init/version.c and needed AFAICS.

The one in capability.h should be able to go when has_capability* are
turned into functions.  They couldn't be turned into static functions
in capability.h (left as exercise for reader), but they can be made
full-fledged functions in kernel/capability.c.  I will do that in a
follow-on patch and try to remove the extra init_user_ns defines as
well.

thanks,
-serge

  reply	other threads:[~2011-03-01 23:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 15:01 [PATCH 01/10] Add a user_namespace as creator/owner of uts_namespace Serge E. Hallyn
2011-02-24 15:02 ` [PATCH 02/10] security: Make capabilities relative to the user namespace Serge E. Hallyn
2011-02-24 15:02 ` [PATCH 03/10] allow sethostname in a container Serge E. Hallyn
2011-02-24 15:02 ` [PATCH 04/10] allow killing tasks in your own or child userns Serge E. Hallyn
2011-02-24 15:02 ` [PATCH 05/10] Allow ptrace from non-init user namespaces Serge E. Hallyn
2011-02-24 16:57   ` David Howells
2011-02-24 15:02 ` [PATCH 06/10] user namespaces: convert all capable checks in kernel/sys.c Serge E. Hallyn
2011-02-24 15:03 ` [PATCH 07/10] add a user namespace owner of ipc ns Serge E. Hallyn
2011-02-24 15:03 ` [PATCH 08/10] user namespaces: convert several capable() calls Serge E. Hallyn
2011-02-24 15:03 ` [PATCH 09/10] userns: check user namespace for task->file uid equivalence checks Serge E. Hallyn
2011-03-01 22:24   ` Nathan Lynch
2011-03-01 23:07     ` Serge E. Hallyn [this message]
2011-02-24 15:03 ` [PATCH 10/10] rename is_owner_or_cap to inode_owner_or_capable Serge E. Hallyn
2011-02-24 17:03 ` [PATCH 01/10] Add a user_namespace as creator/owner of uts_namespace David Howells
2011-03-01  0:28 ` Andrew Morton
2011-03-01  5:37   ` Serge E. Hallyn

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=20110301230729.GA28694@hallyn.com \
    --to=serge.hallyn@canonical.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=ntl@pobox.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