Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753172AbZLaCoc (ORCPT ); Wed, 30 Dec 2009 21:44:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752991AbZLaCob (ORCPT ); Wed, 30 Dec 2009 21:44:31 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:61188 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752891AbZLaCoa convert rfc822-to-8bit (ORCPT ); Wed, 30 Dec 2009 21:44:30 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=TtlFY8E2brRg5zB+ZYA2+yncdbY+mmqjmhP+RH3YF90xQJ89K7UDjLZeXMpJj/kOYr XAVNPPPUKEl21bC7Z9Vroz3DWf3TY8BPMJUOXy9B3Xyrvv4QEymeyzgmbMQJRD/SrAvZ 7hvRl+ab6Hk1gh0eeZYv7SDk65kMU8CG0wI9U= MIME-Version: 1.0 In-Reply-To: <20091230230042.5d2e78ac@lxorguk.ukuu.org.uk> References: <551280e50912300652r1007dee0j8de750bf33af9b3c@mail.gmail.com> <20091230183513.GC14493@us.ibm.com> <20091230201712.GA23999@us.ibm.com> <20091230212931.233003b9@lxorguk.ukuu.org.uk> <20091230230042.5d2e78ac@lxorguk.ukuu.org.uk> From: Bryan Donlan Date: Wed, 30 Dec 2009 21:44:05 -0500 Message-ID: <3e8340490912301844p4fddaf57ke58ceeba9582e0fa@mail.gmail.com> Subject: Re: [RFC][PATCH v3] Unprivileged: Disable raising of privileges To: Alan Cox Cc: "Eric W. Biederman" , "Serge E. Hallyn" , "Andrew G. Morgan" , Benny Amorsen , Michael Stone , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-security-module@vger.kernel.org, Andi Kleen , David Lang , Oliver Hartkopp , Herbert Xu , Valdis Kletnieks , Evgeniy Polyakov , "C. Scott Ananian" , James Morris , Bernie Innocenti , Mark Seaborn , Randy Dunlap , =?ISO-8859-1?Q?Am=E9rico_Wang?= , Tetsuo Handa , Samir Bellabes , Casey Schaufler , Pavel Machek , Al Viro Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2774 Lines: 56 On Wed, Dec 30, 2009 at 6:00 PM, Alan Cox wrote: > On Wed, 30 Dec 2009 13:36:57 -0800 > ebiederm@xmission.com (Eric W. Biederman) wrote: > >> Alan Cox writes: >> >> >> Added bprm->nosuid to make remove the need to add >> >> duplicate error prone checks. ?This ensures that >> >> the disabling of suid executables is exactly the >> >> same as MNT_NOSUID. >> > >> > Another fine example of why we have security hooks so that we don't get a >> > kernel full of other "random security idea of the day" hacks. >> >> Well it comes from plan 9. ?Except there they just simply did not >> implement suid. ?What causes you to think dropping the ability >> to execute suid executables is a random security idea of the day? > > Well to be fair its random regurgitated security idea of every year or > two. > > More to the point - we have security_* hooks so this kind of continuous > security proposal turdstream can stay out of the main part of the kernel. > > Cleaning up the mechanism by which NOSUID is handled in kernel seems a > good idea. Adding wacky new prctls and gunk for it doesn't, and belongs > in whatever security model you are using via the security hooks. I see this as being a security-model agnostic API - the reason being, the application is specifying a policy for itself that has meaning in all existing security models, and which does not require administrator intervention to configure. Rather than reimplementing this for each security model, it's far better to do it just once. Moreover, by having a single, common API, the application can state the general policy "I will never need to gain priviliges over exec" without needing to know what LSM is in use. The future goal of this API is to allow us to relax restrictions on creating new namespaces, chrooting, and otherwise altering the task's environment in ways that may confuse privileged applications. Since security hooks are all about making the existing security restrictions _stricter_, it's not easy to later relax these using the security hook model. And once we put in the general requirement that "this task shall never gain privilege", it should be safe to relax these restrictions for _all_ security models. In short, this is something which is meaningful for all existing LSMs and should be implemented in a central point, it will make things easier for the namespace folks, and since it will lead to relaxing restrictions later, it doesn't make sense to put it in a LSM as they stand now. -- 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/