Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4565750yba; Tue, 30 Apr 2019 00:03:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGs54OEA44Sk1QTUPjH278t9YtijBhYR77VdiK+7FZQurhFyidzxhsgEQH3Jh9zWlTTsf4 X-Received: by 2002:a63:6cc7:: with SMTP id h190mr62976125pgc.350.1556607833041; Tue, 30 Apr 2019 00:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556607833; cv=none; d=google.com; s=arc-20160816; b=J/hwELkhleka3EwnlTcblSD+7qBTiqOaOZ5klyJ8bwK4+2Dfe+zzjmhfYCBchKKf/A DUEt4+U7XWuguoaVxt7pAVEmc7amkWo7vleMGA8M4yJuj+EdTKB8G2jarPUiC6zmKgqV nbC9qQyPxlzZ8amRJGU44ADhwg2n0aT8T0W5trnur/90fysS2GxZo16J5/6dph7lJXqg kXynWmKvDpjjHBDv2hdGjGaRX8AkKrej2xQCIiedfgciZI4Qtmh1gieDL69+jDFstKPi clme8/U2V2883XJm38jYpmF0gXT4Zk9+KchNCYT2IYSP3/tS9QtHmc/hTIDbYcvW1MHv vA4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=xFafzli2tBus/gfwtCIgGz3dMDT62kZRe0H4IRSt0vw=; b=NZzFl73c8EOXXgc7GdUenwlDyV2IhfSbekejn9DyDma+vojQjchBgrAqd0oyOvaRFu iQTzEeNp9+hceVZrW4qlMBgAYFVUfNM9DDj7A6zgPhYtGmIh/bjtmdNkCCkrkBDiSNrT ZGONslY0dLAAsfesFDqa+Vc7OQ2TwiYaIIYXp+EV0ccuOODzMDkUrzJneQvRiZQH/pWF AOY8qQcoP9AxxKMjrD7HjH7QZWxHE2DL3uJ457yVTuAeHtwIlB/SaW5q3Phwizia0QTY J3pwW3M2m0vWiqTwDYmxy21Rez2c7UIrelkcEUHToiaz/zKoR6nwH8in6RoqLDgdvqxO yFjw== 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 d23si142380pgi.145.2019.04.30.00.03.37; Tue, 30 Apr 2019 00:03:53 -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 S1726436AbfD3HCE (ORCPT + 99 others); Tue, 30 Apr 2019 03:02:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35492 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbfD3HCE (ORCPT ); Tue, 30 Apr 2019 03:02:04 -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 3CC433091740; Tue, 30 Apr 2019 07:02:03 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0807D1001E86; Tue, 30 Apr 2019 07:01:53 +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> <87zho8bl8x.fsf@oldenburg2.str.redhat.com> Date: Tue, 30 Apr 2019 09:01:52 +0200 In-Reply-To: (Linus Torvalds's message of "Mon, 29 Apr 2019 14:31:30 -0700") Message-ID: <87muk8asdb.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.41]); Tue, 30 Apr 2019 07:02:04 +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 1:38 PM Florian Weimer wrote: >> >> 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. > > What broken library does that? > > Sure, we didn't have a proper vfork() long long long ago. But that > predates both git and BK, so it's some time in the 90's. We've had a > proper vfork() *forever*. It's not so much about libraries, it's alternative implementations of the system call interface: valgrind, qemu-user and WSL. For valgrind and qemu-user, it's about cloning the internal data structures, so that the subprocess does not clobber what's in the parent process (which may have multiple threads and may not be fully blocked due to vfork). For WSL, who knows what's going on there. >> 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. > > No. Just make a bug-report to whatever broken library you use. What's > the point of having a library that can't even get vfork() right? Why > would you want to have a flag to say "vfork is broken"? It's apparently quite difficult to fix valgrind and qemu-user. WSL is apparently not given the resources it needs, yet a surprising number of people see it as a viable replacement and report what are essentially vfork-related bugs. If I had the flag, I could at least fix posix_spawn in glibc to consult it before assuming that vfork shares address space. (The sharing allows straightforward reporting of the vfork error code, without resorting to pipes or creating a MAP_SHARED mapping.) For obvious reasons, I do not want to apply the workaround unconditionally. Thanks, Florian