The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Hillf Danton" <hillf.zj@alibaba-inc.com>
To: "'Sergei Zviagintsev'" <sergei@s15v.net>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"'Daniel Mack'" <daniel@zonque.org>,
	"'David Herrmann'" <dh.herrmann@googlemail.com>,
	"'Djalal Harouni'" <tixxdz@opendz.org>,
	"linux-kernel" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 07/44] kdbus: Fix comment on translation of caps between namespaces
Date: Fri, 09 Oct 2015 11:43:22 +0800	[thread overview]
Message-ID: <05ec01d10244$a5bddc10$f1399430$@alibaba-inc.com> (raw)

> @@ -730,15 +730,21 @@ static void kdbus_meta_export_caps(struct kdbus_meta_caps *out,
> 
>  	/*
>  	 * This translates the effective capabilities of 'cred' into the given
> -	 * user-namespace. If the given user-namespace is a child-namespace of
> -	 * the user-namespace of 'cred', the mask can be copied verbatim. If
> -	 * not, the mask is cleared.
> -	 * There's one exception: If 'cred' is the owner of any user-namespace
> -	 * in the path between the given user-namespace and the user-namespace
> -	 * of 'cred', then it has all effective capabilities set. This means,
> -	 * the user who created a user-namespace always has all effective
> -	 * capabilities in any child namespaces. Note that this is based on the
> -	 * uid of the namespace creator, not the task hierarchy.
> +	 * user namespace according to the following rules:
> +	 *
> +	 * - If 'cred' is a member of the given user namespace or any of its
> +	 *   parent user namespaces, the mask is copied verbatim. That is, if

Clearer/Better if "if not, the mask is cleared." is reserved.

> +	 *   a process has a capability in a user namespace, then it has it in
> +	 *   all child user namespaces too.
> +	 *
> +	 * - If the effective UID of 'cred' matches the owner of the given user
> +	 *   namespace or any of its parent user namespaces and 'cred' itself
> +	 *   resides in the parent of that user namespace which it owns, then
> +	 *   it has all effective capabilities set. This means that the user
> +	 *   who created a user namespace always has all effective capabilities
> +	 *   in all child namespaces while staying in the parent of the user
> +	 *   namespace which it owns. Note that this is based on the UID of the
> +	 *   namespace creator, not the task hierarchy.
>  	 */
>  	for (iter = user_ns; iter; iter = iter->parent) {
>  		if (iter == cred->user_ns) {
> --
> 1.8.3.1
> 


             reply	other threads:[~2015-10-09  3:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09  3:43 Hillf Danton [this message]
2015-10-09  7:34 ` [PATCH 07/44] kdbus: Fix comment on translation of caps between namespaces Sergei Zviagintsev
  -- strict thread matches above, loose matches on Subject: below --
2015-10-08 11:31 [PATCH 00/44] kdbus cleanups Sergei Zviagintsev
2015-10-08 11:31 ` [PATCH 07/44] kdbus: Fix comment on translation of caps between namespaces Sergei Zviagintsev

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='05ec01d10244$a5bddc10$f1399430$@alibaba-inc.com' \
    --to=hillf.zj@alibaba-inc.com \
    --cc=daniel@zonque.org \
    --cc=dh.herrmann@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergei@s15v.net \
    --cc=tixxdz@opendz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox