From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Weimer Subject: Re: RFC: on adding new CLONE_* flags [WAS Re: [PATCH 0/4] clone: add CLONE_PIDFD] Date: Mon, 29 Apr 2019 22:38:06 +0200 Message-ID: <87zho8bl8x.fsf@oldenburg2.str.redhat.com> References: <20190414201436.19502-1-christian@brauner.io> <20190415195911.z7b7miwsj67ha54y@yavin> <20190420071406.GA22257@ip-172-31-15-78> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: (Linus Torvalds's message of "Mon, 29 Apr 2019 13:21:06 -0700") Sender: linux-kernel-owner@vger.kernel.org To: Linus Torvalds Cc: Jann Horn , Kevin Easton , Andy Lutomirski , Christian Brauner , Aleksa Sarai , "Enrico Weigelt, metux IT consult" , Al Viro , David Howells , Linux API , LKML , "Serge E. Hallyn" , Arnd Bergmann , "Eric W. Biederman" , Kees Cook , Thomas Gleixner , Michael Kerrisk , Andrew Morton , Oleg Nesterov , Joel Fernandes , Daniel Colascione List-Id: linux-api@vger.kernel.org * Linus Torvalds: > On Mon, Apr 29, 2019 at 12:55 PM Jann Horn wrote: >> >> ... I guess that already has a name, and it's called vfork(). (Well, >> except that the Linux vfork() isn't a real vfork().) > > What? > > Linux vfork() is very much a real vfork(). What do you mean? In Linux-as-the-ABI (as opposed to Linux-as-the-implementation), vfork is sometimes implemented as fork, so applications cannot rely on the vfork behavior regarding the stopped parent and the shared address space. In fact, it would be nice to have a flag we can check in the posix_spawn implementation, so that we can support vfork-as-fork without any run time cost to native Linux. Thanks, Florian From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60C82C43219 for ; Mon, 29 Apr 2019 20:38:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E47021670 for ; Mon, 29 Apr 2019 20:38:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729424AbfD2UiR (ORCPT ); Mon, 29 Apr 2019 16:38:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36894 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729252AbfD2UiR (ORCPT ); Mon, 29 Apr 2019 16:38:17 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B87F308626C; Mon, 29 Apr 2019 20:38:16 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-123.ams2.redhat.com [10.36.116.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C76F01001959; Mon, 29 Apr 2019 20:38:08 +0000 (UTC) From: Florian Weimer To: Linus Torvalds Cc: Jann Horn , Kevin Easton , Andy Lutomirski , Christian Brauner , Aleksa Sarai , "Enrico Weigelt\, metux IT consult" , Al Viro , David Howells , Linux API , LKML , "Serge E. Hallyn" , Arnd Bergmann , "Eric W. Biederman" , Kees Cook , Thomas Gleixner , Michael Kerrisk , Andrew Morton , Oleg Nesterov , Joel Fernandes , Daniel Colascione Subject: Re: RFC: on adding new CLONE_* flags [WAS Re: [PATCH 0/4] clone: add CLONE_PIDFD] References: <20190414201436.19502-1-christian@brauner.io> <20190415195911.z7b7miwsj67ha54y@yavin> <20190420071406.GA22257@ip-172-31-15-78> Date: Mon, 29 Apr 2019 22:38:06 +0200 In-Reply-To: (Linus Torvalds's message of "Mon, 29 Apr 2019 13:21:06 -0700") Message-ID: <87zho8bl8x.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 29 Apr 2019 20:38:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Linus Torvalds: > On Mon, Apr 29, 2019 at 12:55 PM Jann Horn wrote: >> >> ... I guess that already has a name, and it's called vfork(). (Well, >> except that the Linux vfork() isn't a real vfork().) > > What? > > Linux vfork() is very much a real vfork(). What do you mean? In Linux-as-the-ABI (as opposed to Linux-as-the-implementation), vfork is sometimes implemented as fork, so applications cannot rely on the vfork behavior regarding the stopped parent and the shared address space. In fact, it would be nice to have a flag we can check in the posix_spawn implementation, so that we can support vfork-as-fork without any run time cost to native Linux. Thanks, Florian