Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1176913

Re: [PATCH 5/6] kdbus: pin namespaces on HELLO

From David Herrmann <dh.herrmann@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 5/6] kdbus: pin namespaces on HELLO
Date 2015-07-05 11:10 +0200
Message-ID <pIO5Y-W8-17@gated-at.bofh.it> (permalink)
References <pHI2C-gz-9@gated-at.bofh.it> <pHIci-jZ-1@gated-at.bofh.it> <pIh0l-5my-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi

On Fri, Jul 3, 2015 at 11:44 PM, Sergei Zviagintsev <sergei@s15v.net> wrote:
> On Thu, Jul 02, 2015 at 10:28:33AM +0200, David Herrmann wrote:
>>       /*
>> -      * This translates the effective capabilities of 'cred' into the current
>> -      * user-namespace. If the current user-namespace is a child-namespace of
>> +      * 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 current user-namespace and the 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.
>>        */
>> -     for (iter = current_user_ns(); iter; iter = iter->parent) {
>> +     for (iter = user_ns; iter; iter = iter->parent) {
>
> Is check `iter' for being not NULL is needed here? I mean, `iter' takes
> range from `user_ns' (which is cred->user_ns) to &init_user_ns.

This patch does not change the logic of this lookup, but only the
source of the user-namespace. Hence, a change of this loop-head would
be inappropriate.
Nevertheless, I prefer being rather safe than sorry here, so I don't
mind the current code.

Thanks
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Miscellaneous kdbus fixes and code removal David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 3/6] kdbus: drop unused 'bloom_generation' field David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 4/6] kdbus: drop support for required attach-flags on buses David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 5/6] kdbus: pin namespaces on HELLO David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
    Re: [PATCH 5/6] kdbus: pin namespaces on HELLO David Herrmann <dh.herrmann@gmail.com> - 2015-07-05 11:10 +0200
  [PATCH 6/6] kdbus: fix NULL-deref in activator cleanup David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
  [PATCH 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
    [PATCH v2 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS David Herrmann <dh.herrmann@gmail.com> - 2015-07-05 10:40 +0200

csiph-web