From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030451AbWGNODi (ORCPT ); Fri, 14 Jul 2006 10:03:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030452AbWGNODi (ORCPT ); Fri, 14 Jul 2006 10:03:38 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:2180 "EHLO e33.co.us.ibm.com") by vger.kernel.org with ESMTP id S1030451AbWGNODh (ORCPT ); Fri, 14 Jul 2006 10:03:37 -0400 Date: Fri, 14 Jul 2006 09:02:37 -0500 From: "Serge E. Hallyn" To: "Eric W. Biederman" Cc: "Serge E. Hallyn" , Dave Hansen , Cedric Le Goater , linux-kernel@vger.kernel.org, Andrew Morton , Kirill Korotaev , Andrey Savochkin , Herbert Poetzl , Sam Vilain Subject: Re: [PATCH -mm 5/7] add user namespace Message-ID: <20060714140237.GD28436@sergelap.austin.ibm.com> References: <44B50088.1010103@fr.ibm.com> <44B684A5.2040008@fr.ibm.com> <20060713174721.GA21399@sergelap.austin.ibm.com> <1152815391.7650.58.camel@localhost.localdomain> <20060713214101.GB2169@sergelap.austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Quoting Eric W. Biederman (ebiederm@xmission.com): > "Serge E. Hallyn" writes: > > > Quoting Eric W. Biederman (ebiederm@xmission.com): > >> Dave Hansen writes: > >> > >> > On Thu, 2006-07-13 at 12:14 -0600, Eric W. Biederman wrote: > >> >> Maybe. I really think the sane semantics are in a different uid namespace. > >> >> So you can't assumes uids are the same. Otherwise you can't handle open > >> >> file descriptors or files passed through unix domain sockets. > >> > > >> > Eric, could you explain this a little bit more? I'm not sure I > >> > understand the details of why this is a problem? > >> > >> Very simply. > >> > >> In the presence of a user namespace. > >> All comparisons of a user equality need to be of the tuple (user namespace, > > user id). > >> Any comparison that does not do that is an optimization. > >> > >> Because you can have access to files created in another user namespace it > >> is very unlikely that optimization will apply very frequently. The easy > > scenario > >> to get access to a file descriptor from another context is to consider unix > >> domain sockets. > > > > What does that have to do with uids? If you receive an fd, uids don't > > matter in any case. The only permission checks which happen are LSM > > hooks, which should be uid-agnostic. > > You are guest uid 0. You get a directory file descriptor from another namespace. > You call fchdir. > > If you permission checks are not (user namespace, uid) what can't you do? File descripters can only be passed over a unix socket, right? So this seems to fall into the same "userspace should set things up sanely" argument you've brought up before. Don't get me wrong though - the idea of using in-kernel keys as cross-namespace uid's is definately interesting. -serge