Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754932Ab0DUOPb (ORCPT ); Wed, 21 Apr 2010 10:15:31 -0400 Received: from earthlight.etchedpixels.co.uk ([81.2.110.250]:36711 "EHLO www.etchedpixels.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754867Ab0DUOP1 (ORCPT ); Wed, 21 Apr 2010 10:15:27 -0400 Date: Wed, 21 Apr 2010 15:19:17 +0100 From: Alan Cox To: "Serge E. Hallyn" Cc: lkml , David Howells , Ashwin Ganti , Greg KH , rsc@swtch.com, ericvh@gmail.com, linux-security-module@vger.kernel.org, Ron Minnich , jt.beard@gmail.com, Andrew Morton , Andrew Morgan , oleg@us.ibm.com, Eric Paris , "Eric W. Biederman" , linux-api@vger.kernel.org, Randy Dunlap Subject: Re: [PATCH 3/3] p9auth: add p9auth driver Message-ID: <20100421151917.5ae20265@lxorguk.ukuu.org.uk> In-Reply-To: <20100421133917.GB16326@us.ibm.com> References: <20100421012749.GA21338@us.ibm.com> <20100421012908.GB24251@us.ibm.com> <20100421102739.6ad932fb@lxorguk.ukuu.org.uk> <20100421133917.GB16326@us.ibm.com> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.9; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1754 Lines: 37 > sorry I thought I had cc:d you, bc I was pretty sure you'd have some > neat ideas. Like this one. > > One could try to argue that this makes every linux process susceptible > to a trojan making it grant its userid to other tasks, but of course > that's silly since the trojan could just fork. Well, what this would > buy the attacker is the ability to sit inconspicuously under his old > userid, holding on to the fd until the admin goes out to coffee before > switching userids. Possibly, could you put a timestamp in the passed object ? (Given the expiry of such a uid offer is kind of policy) > The other thing is that offhand I think the server can't easily tell > from the socket which user namespace the client is in, as ucred only > has .uid. Though (1) we might need to create a 'struct puser' analogous > to 'struct pid' for signals anyway, (2) userspace can segragate with > fs or net_ns (if abstract sock), and (3) client in a container > presumably won't be able to authenticate itself to server on the > host anyway. That I think needs fixing anyway and now is a good time as any to do it. If you are going to be able to pass userids then you need to be sure you don't get passed a handle with a uid change on it that you didn't want so adding another object type and option of some kind to accept them has to occur anyway. That also btw needs fixing for other reasons - more than one daemon has been written that generically uses recvmsg and so can be attacked with FD leaks >-) Alan -- 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/