Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933092AbcLMSe6 (ORCPT ); Tue, 13 Dec 2016 13:34:58 -0500 Received: from nm11-vm6.bullet.mail.ne1.yahoo.com ([98.138.91.104]:51315 "EHLO nm11-vm6.bullet.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932753AbcLMSe4 (ORCPT ); Tue, 13 Dec 2016 13:34:56 -0500 X-Yahoo-Newman-Id: 87709.98703.bm@smtp111.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: gLqwyNYVM1lZ4yoZfPCezxmUw7mkJfO_iH0k3Gv7nGQ3LRy _WC5ZWfQane.9G02iXGxkB3Br6w3fW3k_GxTUvGx9bbE94zvEgySc0XAjBXp CTWk27A8T60aTyPWw16631v6rFkrUgQhnClwzhTdY8oSKeDa9L8RPnBylr5g mxBsXYJksXuzIzHh1EucTBhBadmRJNlJ7igSgFmxGgHC7q8itk7ec8d8w87t 7Vb7XbQXaeq4lEkKqDVwnMEr6ucrjSnk.alRm6zAJruJCE8B6Ih7pFMVtBxp iCLUenNHI8vwUN_bUEh3OoD.4Yj1f5bB1wqJ.ty.lT7C.82nmD22HAgDbNHR 95Nxf_KQFJZlvYlA1Vnbt4p6yZwFnegsoUrm.fft5qDNyZBGS_E0YeQ_UCIU qE63rBNb1D2vocA18V2I.YT1mWqvzMiCPedJT_tYsPN7SbEUgevh7q2vONz0 z8_V4Syd2HPAsTHabTSyJEgO.e6ffZKHZQkI_CCmHKRqmZJnUEMNUDtm8u0M HWoibHWg9K2Se5HrjzO6pghNOfL3Jjxv3WC6naqhyY.9Vfv4nh7HIPPoZMMU GoqViJX_KqBodjC9Cjw2T X-Yahoo-SMTP: OIJXglSswBDfgLtXluJ6wiAYv6_cnw-- Subject: Re: [PATCH v5] cgroup: Add new capability to allow a process to migrate other tasks between cgroups To: John Stultz References: <1481593143-18756-1-git-send-email-john.stultz@linaro.org> <221e80bd-3d99-6c35-dcd3-b2547f0abb11@schaufler-ca.com> <4c60e1be-c00a-5f26-f5de-7d32b9cb0f62@schaufler-ca.com> Cc: Michael Kerrisk , lkml , Tejun Heo , Li Zefan , Jonathan Corbet , "open list:CONTROL GROUP (CGROUP)" , Android Kernel Team , Rom Lemarchand , Colin Cross , Dmitry Shmidt , Todd Kjos , Christian Poetzsch , Amit Pundir , Dmitry Torokhov , Kees Cook , "Serge E . Hallyn" , Andy Lutomirski , Linux API From: Casey Schaufler Message-ID: Date: Tue, 13 Dec 2016 10:32:14 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2451 Lines: 45 On 12/13/2016 10:13 AM, John Stultz wrote: > On Tue, Dec 13, 2016 at 9:48 AM, Casey Schaufler wrote: >> On 12/13/2016 9:24 AM, John Stultz wrote: >>> On Tue, Dec 13, 2016 at 9:17 AM, Casey Schaufler wrote: >>>> On 12/13/2016 8:49 AM, John Stultz wrote: >>>>> On Tue, Dec 13, 2016 at 8:39 AM, Casey Schaufler wrote: >>>>>> On 12/13/2016 1:47 AM, Michael Kerrisk (man-pages) wrote: >>>>>>> How about CAP_CGROUP_CONTROL or some such, with the idea that this >>>>>>> might be a capability that allows the holder to step outside usual >>>>>>> cgroup rules? At the moment, that capability would allow only one such >>>>>>> step, but maybe there would be others in the future. >>>>>> I agree, but want to put it more strongly. The granularity of >>>>>> capabilities can never be fine enough for some people, and this >>>>>> is an example of a case where you're going a bit too far. If the >>>>>> use case is Android as you say, you don't need this. As my friends >>>>>> on the far side of the aisle would say, "just write SELinux policy" >>>>>> to correctly control access as required. >>>>> So.. The trouble is that while selinux is good for restricting >>>>> permissions, the in-kernel permission checks here are already too >>>>> restrictive. >>>> Why did the original authors of cgroups make it that restrictive? >>>> If there isn't a good reason, loosen it up. If there is a good >>>> reason, then pay heed to it. >>> That's what this patch is proposing. And I agree with Michael that the >>> newly proposed cap was a bit to narrowly focused on my immediate use >>> case, and broadening it to CGROUP_CONTROL is smart. Then that >>> capability could be further restricted w/ selinux policy, as you >>> suggest. >> Adding a new capability is unnecessary. The current use of CAP_SYS_NICE, >> while arguably obscure, provides as much "security" as a new capability >> does. While cgroups are a wonderful thing, they don't need a separate >> capability. > The trouble is that CAP_SYS_NICE or _RESOURCE (which was tried in an > earlier version of this patch) aren't necessarily appropriate for > non-android systems. See Andy's objection here: > https://lkml.org/lkml/2016/11/8/946 Then we need to see what those as-yet-unimplemented systems require and how to address them. I don't think that taking the "someone might want it" approach is really appropriate. > > thanks > -john >