From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754574AbcJETSV (ORCPT ); Wed, 5 Oct 2016 15:18:21 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:34970 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753002AbcJETST (ORCPT ); Wed, 5 Oct 2016 15:18:19 -0400 MIME-Version: 1.0 In-Reply-To: <20161005191056.GB31873@dtor-ws> References: <1475556090-6278-1-git-send-email-john.stultz@linaro.org> <1475556090-6278-3-git-send-email-john.stultz@linaro.org> <20161005191056.GB31873@dtor-ws> From: John Stultz Date: Wed, 5 Oct 2016 12:18:17 -0700 Message-ID: Subject: Re: [PATCH 2/2] cgroup: Add a allow_attach policy for Android To: Dmitry Torokhov Cc: lkml , Rom Lemarchand , Tejun Heo , Li Zefan , Jonathan Corbet , cgroups@vger.kernel.org, Android Kernel Team , Colin Cross , Dmitry Shmidt , Todd Kjos , Christian Poetzsch , Amit Pundir , Ricky Zhou Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 5, 2016 at 12:10 PM, Dmitry Torokhov wrote: > On Mon, Oct 03, 2016 at 09:41:30PM -0700, John Stultz wrote: >> +#ifdef CONFIG_CGROUP_NICE_ATTACH >> +int cgroup_nice_allow_attach(struct cgroup_taskset *tset) >> +{ >> + const struct cred *cred = current_cred(), *tcred; >> + struct task_struct *task; >> + struct cgroup_subsys_state *css; >> + >> + if (capable(CAP_SYS_NICE)) >> + return 0; >> + >> + cgroup_taskset_for_each(task, css, tset) { >> + tcred = __task_cred(task); > > __task_cred() requires RCU lock (courtesy Ricky Z). Again, hopefully this isn't an issue with the new approach, but for the short term I'll see if we can get this fixed in the android tree. Thanks again for your careful review! -john From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Stultz Subject: Re: [PATCH 2/2] cgroup: Add a allow_attach policy for Android Date: Wed, 5 Oct 2016 12:18:17 -0700 Message-ID: References: <1475556090-6278-1-git-send-email-john.stultz@linaro.org> <1475556090-6278-3-git-send-email-john.stultz@linaro.org> <20161005191056.GB31873@dtor-ws> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9szoFz/YfGW2NYKs37DDbDAwdW+/XBQKaSg1NlD44OA=; b=iovFx/qZvm4gIrlOLov7anXTbGhGO/YrkMvr4HGzGpjIBWdsOsCEhdTlCn4jMKLzbg IOI3Odl/fHGTUDON+7XVQlHvFQRAubCzY7uxlnONGFpSQRgDFSS35AazpvMKEVMmhnnT LPOo+odhHI+aL8hQDrkkJ/gT+gxhWjd6IF6r0= In-Reply-To: <20161005191056.GB31873@dtor-ws> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Torokhov Cc: lkml , Rom Lemarchand , Tejun Heo , Li Zefan , Jonathan Corbet , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Android Kernel Team , Colin Cross , Dmitry Shmidt , Todd Kjos , Christian Poetzsch , Amit Pundir , Ricky Zhou On Wed, Oct 5, 2016 at 12:10 PM, Dmitry Torokhov wrote: > On Mon, Oct 03, 2016 at 09:41:30PM -0700, John Stultz wrote: >> +#ifdef CONFIG_CGROUP_NICE_ATTACH >> +int cgroup_nice_allow_attach(struct cgroup_taskset *tset) >> +{ >> + const struct cred *cred = current_cred(), *tcred; >> + struct task_struct *task; >> + struct cgroup_subsys_state *css; >> + >> + if (capable(CAP_SYS_NICE)) >> + return 0; >> + >> + cgroup_taskset_for_each(task, css, tset) { >> + tcred = __task_cred(task); > > __task_cred() requires RCU lock (courtesy Ricky Z). Again, hopefully this isn't an issue with the new approach, but for the short term I'll see if we can get this fixed in the android tree. Thanks again for your careful review! -john