From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [RESEND][PATCH v4] cgroup: Use CAP_SYS_RESOURCE to allow a process to migrate other tasks between cgroups Date: Tue, 6 Dec 2016 11:57:45 -0500 Message-ID: <20161206165745.GB17648@mtj.duckdns.org> References: <1478647728-30357-1-git-send-email-john.stultz@linaro.org> <20161109000342.GA42532@ast-mbp.thefacebook.com> <20161206020011.GA22261@mail.hallyn.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kgPJVpU8Av6FLf/uvYNjnb6Fi1jADkpikhsVoYALUCY=; b=xcHgJ/8cOHVgHUvJYzwl3u85q3nfjFFkNqI9+qRR5Rv0unMsKTYz5T3BKzz7ZOPn9H Kq1aEpntQn9fI8CUQPdFopYIGkZPFeBYbecLfiK9O8rfXy2vFcDaLxGd8w/Y8CSOlGAM WqtDATZEySBLmItw1Wi4evXTh6cxilBbxUrU/zdR08L6sZDGnlUebTM0uTscokW9WMot qz012gwUvHL7j4Dze0PoPc+NXUV+c++Ss0qOvCjYgrSjNexI8/v02phdNxIXEgAA4Exr BKpHgkXu5w/ysZnq7R5tMqwqdU6nbz0DyYrt9DjBOEix22hiE1QCgLVn/GPCDL5PIQGo ICdA== Content-Disposition: inline In-Reply-To: <20161206020011.GA22261-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Serge E. Hallyn" Cc: Andy Lutomirski , John Stultz , Alexei Starovoitov , Andy Lutomirski , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Daniel Mack , "David S. Miller" , kafai-b10kYP2dOMg@public.gmane.org, Florian Westphal , Harald Hoyer , Network Development , Sargun Dhillon , Pablo Neira Ayuso , lkml , Li Zefan , Jonathan Corbet , "open list:CONTROL GROUP (CGROUP)" , Android Kernel Team , Rom Lemarchand , Colin Hello, Serge. On Mon, Dec 05, 2016 at 08:00:11PM -0600, Serge E. Hallyn wrote: > > I really don't know. The cgroupfs interface is a bit unfortunate in > > that it doesn't really express the constraints. To safely migrate a > > task, ISTM you ought to have some form of privilege over the task > > *and* some form of privilege over the cgroup. > > Agreed. The problem is that the privilege required should depend on > the controller (I guess). For memory and cpuset, CAP_SYS_NICE seems > right. Perhaps CAP_SYS_RESOURCE would be needed for some.. but then, > as I look through the lists (capabilities(7) and the list of controllers), > it seems like CAP_SYS_NICE works for everything. What else would we need? > Maybe CAP_NET_ADMIN for net_cls and net_prio? CAP_SYS_RESOURCE|CAP_SYS_ADMIN > for pids? Please see my other reply but I don't think it's a good idea to have these extra checks on the side when there already is hierarchical delegation mechanism which should be able to handle both resource control and process management delegation. Thanks. -- tejun From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753150AbcLFQ5v (ORCPT ); Tue, 6 Dec 2016 11:57:51 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:33040 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbcLFQ5r (ORCPT ); Tue, 6 Dec 2016 11:57:47 -0500 Date: Tue, 6 Dec 2016 11:57:45 -0500 From: Tejun Heo To: "Serge E. Hallyn" Cc: Andy Lutomirski , John Stultz , Alexei Starovoitov , Andy Lutomirski , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Daniel Mack , "David S. Miller" , kafai@fb.com, Florian Westphal , Harald Hoyer , Network Development , Sargun Dhillon , Pablo Neira Ayuso , lkml , 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 , Linux API Subject: Re: [RESEND][PATCH v4] cgroup: Use CAP_SYS_RESOURCE to allow a process to migrate other tasks between cgroups Message-ID: <20161206165745.GB17648@mtj.duckdns.org> References: <1478647728-30357-1-git-send-email-john.stultz@linaro.org> <20161109000342.GA42532@ast-mbp.thefacebook.com> <20161206020011.GA22261@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161206020011.GA22261@mail.hallyn.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Serge. On Mon, Dec 05, 2016 at 08:00:11PM -0600, Serge E. Hallyn wrote: > > I really don't know. The cgroupfs interface is a bit unfortunate in > > that it doesn't really express the constraints. To safely migrate a > > task, ISTM you ought to have some form of privilege over the task > > *and* some form of privilege over the cgroup. > > Agreed. The problem is that the privilege required should depend on > the controller (I guess). For memory and cpuset, CAP_SYS_NICE seems > right. Perhaps CAP_SYS_RESOURCE would be needed for some.. but then, > as I look through the lists (capabilities(7) and the list of controllers), > it seems like CAP_SYS_NICE works for everything. What else would we need? > Maybe CAP_NET_ADMIN for net_cls and net_prio? CAP_SYS_RESOURCE|CAP_SYS_ADMIN > for pids? Please see my other reply but I don't think it's a good idea to have these extra checks on the side when there already is hierarchical delegation mechanism which should be able to handle both resource control and process management delegation. Thanks. -- tejun