Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9279954ybl; Fri, 17 Jan 2020 09:13:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwx4EzGJNVt2HEqBlvA6PCoKd2CxDko1ZAEF8qyAadVwX8kb5QDlmWNiQNuxKGOF/epzFoo X-Received: by 2002:a54:4117:: with SMTP id l23mr4052917oic.140.1579281237843; Fri, 17 Jan 2020 09:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579281237; cv=none; d=google.com; s=arc-20160816; b=DrO0b6U8OCxRI48/W/ztUIfL0EoDYcw+lGaipdzCZ58gfPI8qmXSzIhFeJT5eHxJpn UI7JGmz4i9mF2Ygm22VnIUH4p76+u85dkakXzvyCWYVuC3lf3jrLZmGPS7ZQvQ7OF4pU oPxlej7PlBD1sr8/mSSBC5F2EPlb0+igPyRBa/fAhWvcy8T7GMOgiMNyZ0ldNBkY+DIX CDU9mDN49lqYU77T4PquBQCDNndUdkdFdPGfNM8iU7tqeaZ3ByjllLYTEcqmxJY+FvcL TL3wU9WganvBX8NkH0g5mUxJpH3of+OUplbcFIJ0GTGHkxjEwFFPXdRmFy8I4XFTVGSH i6WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=s/23CMyM7LFFoGuq1IdhR5JgOcWxrr0OdsVPfBN3LcQ=; b=VAAEMySODaUL8L7xw0TLtRUMWgObG1xE8t8ZfWQyBRMbpcYH5PD9OyVFcTNBepmR/K +Bdxo7RtmWOhjw+fZvZEuNOP6VMlC6V0B2r2J/aXXsUrtEI/oMngSJhWq4FWSmVH+OST qZEVB2oEcrMhtkTvUfd4jQuS3lB+GdId6hP9x0oKPsvpUfHS7wDctBioFmUUgBl+O5zB eRqU9CI9xcHMfRB0IynowJfJ/1HwLjIkN8s2g9BRP/mYlLnKtln/ylwgVqOrU3zSDVTl iCjRiiR+jB5Atg4Maho3pDoU0opAGSkOBAFAhrecYmMUenUuorc43CC5Ct8LRSavSLPe HFxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si13775367oij.270.2020.01.17.09.13.45; Fri, 17 Jan 2020 09:13:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728813AbgAQRMd (ORCPT + 99 others); Fri, 17 Jan 2020 12:12:33 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:50460 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbgAQRMd (ORCPT ); Fri, 17 Jan 2020 12:12:33 -0500 Received: from ip5f5bd679.dynamic.kabel-deutschland.de ([95.91.214.121] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1isVAb-0007V1-EI; Fri, 17 Jan 2020 17:12:29 +0000 Date: Fri, 17 Jan 2020 18:12:28 +0100 From: Christian Brauner To: Tejun Heo Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Oleg Nesterov , Johannes Weiner , Li Zefan , Peter Zijlstra , cgroups@vger.kernel.org Subject: Re: [PATCH v2 2/3] clone3: allow spawning processes into cgroups Message-ID: <20200117171228.evtvrny3v7zjcocd@wittgenstein> References: <20191223061504.28716-1-christian.brauner@ubuntu.com> <20191223061504.28716-3-christian.brauner@ubuntu.com> <20200107163204.GB2677547@devbig004.ftw2.facebook.com> <20200108180906.l4mvtdmh7nm2z7sc@wittgenstein> <20200116122944.nj3e66eusxu6sb44@wittgenstein> <20200117165311.GH2677547@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200117165311.GH2677547@devbig004.ftw2.facebook.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 08:53:11AM -0800, Tejun Heo wrote: > Hello, Christian. > > Sorry about late reply. > > On Thu, Jan 16, 2020 at 01:29:44PM +0100, Christian Brauner wrote: > > Could it be that you misread cgroup_attach_permissions()? Because it > > does check for write permissions on the destination cgroup.procs file. > > That's why I've added the cgroup_get_from_file() helper. :) See: > > > > static int cgroup_attach_permissions(struct cgroup *src_cgrp, > > struct cgroup *dst_cgrp, > > struct super_block *sb, bool thread) > > { > > int ret = 0; > > > > ret = cgroup_procs_write_permission(src_cgrp, dst_cgrp, sb); > > if (ret) > > return ret; > > So, if you look at cgroup_procs_write_permission(), it's only checking > the write perm of the common ancestor, not the destination because it > assumes that the destination is already checked by the vfs layer, and > we need to check both. Ok, gimme 20 min. Thanks! Christian