All of lore.kernel.org
 help / color / mirror / Atom feed
From: serge@hallyn.com (Serge E. Hallyn)
To: linux-security-module@vger.kernel.org
Subject: [manpages PATCH] capabilities.7: describe namespaced file capabilities
Date: Sun, 15 Apr 2018 14:22:06 -0500	[thread overview]
Message-ID: <20180415192206.GA26419@mail.hallyn.com> (raw)
In-Reply-To: <770ed948-c807-36d8-b946-ce6f60ffbf67@gmail.com>

Quoting Michael Kerrisk (man-pages) (mtk.manpages at gmail.com):
> On 01/16/2018 06:38 PM, Serge E. Hallyn wrote:
> > Quoting Jann Horn (jannh at google.com):
> >> On Tue, Jan 9, 2018 at 7:52 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> 
> [...]
> 
> >>> +A VFS_CAP_REVISION_3 file capability will take effect only when run in a user namespace
> >>> +whose UID 0 maps to the saved "nsroot", or a descendant of such a namespace.
> >>> +.PP
> >>> +Users with the required privilege may use
> >>> +.BR setxattr(2)
> >>> +to request either a VFS_CAP_REVISION_2 or VFS_CAP_REVISION_3 write.
> >>> +The kernel will automatically convert a VFS_CAP_REVISION_2 to a
> >>> +VFS_CAP_REVISION_3 extended attribute with the "nsroot"
> >>> +set to the root user in the writer's user namespace, or, if a VFS_CAP_REVISION_3
> >>> +extended attribute is specified, then the kernel will map the
> >>> +specified root user ID (which must be a valid user ID mapped in the caller's
> >>> +user namespace) into the initial user namespace.
> >>
> >> Really, "into the initial user namespace"? That may be true for the
> >> kernel-internal representation, but the on-disk representation is the
> >> mapping into the user namespace that contains the mount namespace into
> >> which the file system was mounted, right?
> > 
> > Ah, yes, it is.
> > 
> >>  This would become observable
> >> when a file system is mounted in a different namespace than before, or
> >> when working with FUSE in a namespace.
> > 
> > Yes it would.
> > 
> > Michael, you said you were reworking it, do you mind working this into
> > it as well?
> 
> So, I must confess that I don't really understand this piece of the
> conversation--neither Jann's comments nor Serge's response (Serge, are
> you saying Jann is right or wrong in his comments?). Perhaps this can

He's right.  The point is that if a filesystem is mounted by a user in
a non-init user namespace, then the kernel will map the specified root user ID
into sb->sb_user_ns, not &init_user_ns.

> be clarified as a response to the man page text in the other mail I
> just sent?

Yes, I'll try to do that.

thanks,
Serge
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-04-15 19:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 18:52 [manpages PATCH] capabilities.7: describe namespaced file capabilities Serge E. Hallyn
2018-01-09 18:52 ` Serge E. Hallyn
     [not found] ` <20180109185218.GA21753-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2018-01-14  9:40   ` Michael Kerrisk (man-pages)
2018-01-14  9:40     ` Michael Kerrisk (man-pages)
2018-01-15  4:31     ` Serge E. Hallyn
2018-01-15  4:31       ` Serge E. Hallyn
2018-01-16 17:26 ` Jann Horn
2018-01-16 17:26   ` Jann Horn
2018-01-16 17:38   ` Serge E. Hallyn
2018-01-16 17:38     ` Serge E. Hallyn
     [not found]     ` <20180116173803.GA15538-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2018-01-17 23:44       ` Michael Kerrisk (man-pages)
2018-01-17 23:44         ` Michael Kerrisk (man-pages)
2018-04-13 19:29     ` Michael Kerrisk (man-pages)
2018-04-15 19:22       ` Serge E. Hallyn [this message]
2018-04-22 16:46         ` Michael Kerrisk (man-pages)
2018-04-23 17:57           ` Serge E. Hallyn
2018-04-24 15:13           ` Eric W. Biederman
2018-04-13 19:26   ` Michael Kerrisk (man-pages)
2018-04-16 14:10     ` Jann Horn
2018-04-19 23:57       ` Serge E. Hallyn
2018-05-04 15:10       ` Michael Kerrisk (man-pages)
2018-04-20  0:04     ` 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=20180415192206.GA26419@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=linux-security-module@vger.kernel.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.