Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932508Ab0FGIQ2 (ORCPT ); Mon, 7 Jun 2010 04:16:28 -0400 Received: from smtp-out.google.com ([216.239.44.51]:34000 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847Ab0FGIQ1 convert rfc822-to-8bit (ORCPT ); Mon, 7 Jun 2010 04:16:27 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding; b=X7/ZPIiGv+efWrF2zGsOxtr3iU+CrWTfOyIi4Dl+KDmFnr+5aDO4niuWAl/L4DypF hq2JcJpS0BvJtAKGzrYlw== MIME-Version: 1.0 In-Reply-To: <20100607080357.GB15851@infradead.org> References: <1275834706.7227.545.camel@mulgrave.site> <1275844114.7227.552.camel@mulgrave.site> <20100606190525.GA20517@infradead.org> <20100606192405.GA7559@infradead.org> <20100607080357.GB15851@infradead.org> Date: Mon, 7 Jun 2010 01:16:23 -0700 Message-ID: Subject: Re: [linux-pm] suspend blockers & Android integration From: Brian Swetland To: Christoph Hellwig Cc: James Bottomley , Thomas Gleixner , Alan Cox , Florian Mickler , Vitaly Wool , "Arve Hj?nnev?g" , Arjan van de Ven , tytso@mit.edu, Peter Zijlstra , "H. Peter Anvin" , LKML , Neil Brown , Linux PM , Ingo Molnar , Linux OMAP Mailing List , Linus Torvalds , Felipe Balbi Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2029 Lines: 36 On Mon, Jun 7, 2010 at 1:03 AM, Christoph Hellwig wrote: > On Sun, Jun 06, 2010 at 12:58:10PM -0700, Brian Swetland wrote: >> The group ID stuff works incredibly well for gating device access -- >> we ensure that devices that need access from various processes end up >> with perms like 0660 root audio (say for a raw audio interface), and >> then we assure that processes which have the "may use audio hardware" >> permission are executed with audio as an additional group.  We ended >> up using the same model to control socket, raw socket, and bt socket >> access because at the time we could not find a reasonable way to grant >> or exclude such permissions on a process by process basis. >> Maintaining about 20-30 lines of diffs to make that work was not a bad >> tradeoff (and we don't expect those patches to go upstream).  If >> there's a way to accomplish this without patching the kernel, we're >> all ears. > > I'd have to take a look again on how this is implemented in details. > If it's just overriding the capabilities it's really hard to do in > the current model as the capabilities aren't fine grained enough > currently, even with the existing per-file and per-process capabilities. > If it's mostly overriding regular unix file permissions it's easily > doable with ACLs, or in fact just with group ownership at the filesystem > level, without kernel hacks. For device nodes, we just use group ownership and it works fine with no kernel modifications. For the "can create socket", "can create bt socket", and "can create raw socket" permissions we ended up throwing together a patch tying those operations to being in the appropriate group. Obviously a hack, but it was the most straightforward solution we could find at the time. Brian -- 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/