Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756603AbYJ3Ray (ORCPT ); Thu, 30 Oct 2008 13:30:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752759AbYJ3Rao (ORCPT ); Thu, 30 Oct 2008 13:30:44 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:3840 "EHLO g5t0008.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbYJ3Ran (ORCPT ); Thu, 30 Oct 2008 13:30:43 -0400 From: Paul Moore Organization: Hewlett-Packard To: Eric Paris Subject: Re: [PATCH -v1 1/3] SECURITY: new capable_noaudit interface Date: Thu, 30 Oct 2008 13:29:40 -0400 User-Agent: KMail/1.9.10 Cc: "Serge E. Hallyn" , linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, sds@tycho.nsa.gov, jmorris@nameil.org, morgan@kernel.org, casey@schaufler-ca.com, esandeen@redhat.com References: <20081029190652.31292.5901.stgit@paris.rdu.redhat.com> <200810301246.20328.paul.moore@hp.com> <1225387052.3235.1.camel@localhost.localdomain> In-Reply-To: <1225387052.3235.1.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810301329.40525.paul.moore@hp.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2372 Lines: 59 On Thursday 30 October 2008 1:17:32 pm Eric Paris wrote: > On Thu, 2008-10-30 at 12:46 -0400, Paul Moore wrote: > > On Thursday 30 October 2008 11:29:40 am Serge E. Hallyn wrote: > > > Quoting Eric Paris (eparis@redhat.com): > > > > Add a new capable interface that will be used by systems that > > > > use audit to make an A or B type decision instead of a security > > > > decision. Currently this is the case at least for filesystems > > > > when deciding if a process can use the reserved 'root' blocks > > > > and for the case of things like the oom algorithm determining > > > > if processes are root processes and should be less likely to be > > > > killed. These types of security system requests should not be > > > > audited or logged since they are not really security decisions. > > > > It would be possible to solve this problem like the > > > > vm_enough_memory security check did by creating a new LSM > > > > interface and moving all of the policy into that interface but > > > > proves the needlessly bloat the LSM and provide complex > > > > indirection. > > > > > > > > This merely allows those decisions to be made where they belong > > > > and to not flood logs or printk with denials for thing that are > > > > not security decisions. > > > > > > > > Signed-off-by: Eric Paris > > > > > > Please introduce some meaningful defines instead of passing 0 and > > > 1. I.e. > > > > > > #define CAP_NOAUDIT 0 > > > #define CAP_AUDIT 1 > > > > > > Otherwise, looks fine. > > > > As a general rule aren't boolean arguments like this frowned upon, > > with variations on the function preferred, i.e. something like > > below? > > > > int cap_capable(struct task_struct *tsk, int cap); > > int cap_capable_audit(struct task_struct *tsk, int cap); > > Well from outside the "security" subsystem people should call either > > has_capability() > has_capability_noaudit() > or > capable() (which calls has_capability()) > > How far down do I have to keep duplicating functionality to avoid > booleans? Probably not this far :) Sorry, reading mail too quickly ... -- paul moore linux @ hp -- 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/