From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751562AbbCKLqy (ORCPT ); Wed, 11 Mar 2015 07:46:54 -0400 Received: from mail-qc0-f170.google.com ([209.85.216.170]:34375 "EHLO mail-qc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbbCKLqu (ORCPT ); Wed, 11 Mar 2015 07:46:50 -0400 Date: Wed, 11 Mar 2015 07:46:46 -0400 From: Tejun Heo To: Aleksa Sarai Cc: lizefan@huawei.com, mingo@redhat.com, peterz@infradead.org, richard@nod.at, =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v2 1/2] cgroups: allow a cgroup subsystem to reject a fork Message-ID: <20150311114646.GC25944@htj.duckdns.org> References: <1425010639-16492-1-git-send-email-cyphar@cyphar.com> <1425010639-16492-2-git-send-email-cyphar@cyphar.com> <20150309030636.GC13283@htj.duckdns.org> <20150309065902.GP13283@htj.duckdns.org> <20150310124701.GB28730@htj.duckdns.org> <20150310151728.GD28730@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2015 at 04:16:30PM +1100, Aleksa Sarai wrote: > We know that the task will have its css_set set to task_css_set(current), and > we could just use that in cgroup_can_fork(). The only question is, can > task_css_set(current) change between cgroup_can_fork() and cgroup_post_fork()? Yes, that's what I've been writing in the previous messages. It can change. > If it can change between the two calls, then we're in trouble -- there'd be no > reliable way of checking that the future css_set allows for the fork without > going through the registration of the css_set *proper* in cgroup_post_fork() > unless we hold css_set_rwsem for the entirety of the can_fork() to post_fork() > segment (which I can't imagine is a good idea). Please re-read my previous messages. Thanks. -- tejun