lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 4 Jul 2015 13:26:10 +0200
From:	David Herrmann <dh.herrmann@...il.com>
To:	Sergei Zviagintsev <sergei@...v.net>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Daniel Mack <daniel@...que.org>,
	Djalal Harouni <tixxdz@...ndz.org>
Subject: Re: [PATCH 5/6] kdbus: pin namespaces on HELLO

Hi

On Fri, Jul 3, 2015 at 11:44 PM, Sergei Zviagintsev <sergei@...v.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists