Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp573409yba; Thu, 18 Apr 2019 06:14:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWblILp34M534Z6pqbGsRIiZyEtGvoZRnp5OAJofT6Ey/2gVKlELok2We/Wy63DLlwgpfL X-Received: by 2002:a65:6658:: with SMTP id z24mr9536647pgv.323.1555593253086; Thu, 18 Apr 2019 06:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555593253; cv=none; d=google.com; s=arc-20160816; b=FLjaozPmJ7PH5x6mRvoR1BTZremqEtelzUH+S+r+9UugPgcBG/jt+vk5qwrH724I+4 sXNdAiW3KnyeDLl7F82KOi2B7sdSViRHD6fyFv62THUH9BaGNj2yaPxJvqLMmeRTWmRB wkk8Zf7acUd45JCxPs6dnWiqFdRiYBZLqm5ioHmvMD4lK0tQCs58YgalubeSO9MtQOdM QnN8/D7GIRcTOMVgmI0yvEBjdHvuAZJQSAZbdGniXZzEdnfk5rmXFz/+9Xqhv1ldsKPB 0SbBCaqd/nN0Ye/LOFQE1oXGRW2d3Ggt7ceO9Z70iHrop7xHvXzMLx8euS0mlbeTPsGY XIHw== 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=zD2ie2U+nkvbxU9aFFBum9JyGEb93K8E8TMVeqcdsQs=; b=K11UPFrj0xzwz+9n9elk39yv/Zxg7ho7N+hgBGxRTV2tkNjZXGVRY12XCJvGKL/M+l SOYDDtOtEmM2MUf6o1EWnKm0x46KYEzFQ4Cr4Kn7hArfRvy5MOqBTbgZbE/gwf36F1tR eNTx9GCRu2DH88rSw5yAdpecQOTnGZtM08kINX7GKySysa7ChufA2RulRuK97IKO1kfK z234IoddGEwvIgS3PwBg55+nschaNYUe+VRlf9mOqQngx78+PKTHnvbd9TmBnpC/kdvB cu35Ga3BSPm1f79vAeUUWZGTUtg6EQMOD4on3Lv+wDe9VhG4qlODdcuY/6WNbMSUDGn6 F9DQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f75si2185115pfh.15.2019.04.18.06.13.57; Thu, 18 Apr 2019 06:14:13 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389023AbfDRNMU (ORCPT + 99 others); Thu, 18 Apr 2019 09:12:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39754 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733205AbfDRNMT (ORCPT ); Thu, 18 Apr 2019 09:12:19 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B232E3099FD3; Thu, 18 Apr 2019 13:12:12 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.38]) by smtp.corp.redhat.com (Postfix) with SMTP id E8F4119C65; Thu, 18 Apr 2019 13:12:07 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 18 Apr 2019 15:12:12 +0200 (CEST) Date: Thu, 18 Apr 2019 15:12:07 +0200 From: Oleg Nesterov To: Christian Brauner Cc: torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, jannh@google.com, dhowells@redhat.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, serge@hallyn.com, luto@kernel.org, arnd@arndb.de, ebiederm@xmission.com, keescook@chromium.org, tglx@linutronix.de, mtk.manpages@gmail.com, akpm@linux-foundation.org, cyphar@cyphar.com, joel@joelfernandes.org, dancol@google.com Subject: Re: [PATCH v2 2/5] clone: add CLONE_PIDFD Message-ID: <20190418131206.GB13701@redhat.com> References: <20190418101841.4476-1-christian@brauner.io> <20190418101841.4476-3-christian@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190418101841.4476-3-christian@brauner.io> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 18 Apr 2019 13:12:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/18, Christian Brauner wrote: > > @@ -1674,13 +1729,14 @@ static __latent_entropy struct task_struct *copy_process( > unsigned long clone_flags, > unsigned long stack_start, > unsigned long stack_size, > + int __user *parent_tidptr, > int __user *child_tidptr, > struct pid *pid, > int trace, > unsigned long tls, > int node) > { > - int retval; > + int pidfd = -1, retval; it seems that initialization is unneeded, but this is cosmetic. I see no technical problems, feel free to add my reviewed-by. But let me ask a couple of questions... Why O_CLOEXEC? I am just curious, I do not really care. Should we allow CLONE_THREAD | CLONE_PIDFD ? Are you sure we will never need to extend this interface? If not, then perhaps it make sense to add something like if (CLONE_PIDFD) { unsigned long not_used_yet; if (get_user(not_used_yet, parent_tidptr) || not_used_yet != 0) return -EINVAL; } this way we can easily add more arguments in future or even turn CLONE_PIDFD into CLONE_MORE_ARGS_IN_PARENT_TIDPTR. Not that I think this is really good idea, sys_clone2() makes more sense, but still. Oleg.