From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932399Ab0EDOxN (ORCPT ); Tue, 4 May 2010 10:53:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19061 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932273Ab0EDOxI (ORCPT ); Tue, 4 May 2010 10:53:08 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20100427164245.GA7530@us.ibm.com> References: <20100427164245.GA7530@us.ibm.com> <20100427164139.GA7359@us.ibm.com> To: "Serge E. Hallyn" Cc: dhowells@redhat.com, lkml , Ashwin Ganti , Greg KH , rsc@swtch.com, ericvh@gmail.com, linux-security-module@vger.kernel.org, Ron Minnich , jt.beard@gmail.com, Andrew Morgan , Andrew Morton , Oleg Nesterov , Eric Paris , "Eric W. Biederman" , Randy Dunlap , Michael Kerrisk , Alan Cox , Kyle Moffett , Steve Grubb Subject: Re: [PATCH 1/3] p9auth: split core function out of some set*{u,g}id functions Date: Tue, 04 May 2010 15:52:19 +0100 Message-ID: <3976.1272984739@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Serge E. Hallyn wrote: > Break the core functionality of set{fs,res}{u,g}id into cred_setX > which performs the access checks based on current_cred(), but performs > the requested change on a passed-in cred. > > Export the helpers, since p9auth can be compiled as a module. It > might be worth not allowing modular p9auth to avoid having to export > them. > > Really the setfs{u,g}id helper isn't needed, but move it as > well to keep the code consistent. > > This patch also changes set_user() to use new->user->user_ns. While > technically not needed as all callers should have new->user->user_ns > equal to current_userns(), it is more correct and may prevent surprises > in the future. > > Changelog: > Apr 24: (David Howells) make cred_setresuid etc extern, and > document the helpers in Documentation/credentials.txt. > > Signed-off-by: Serge E. Hallyn Acked-by: David Howells