Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6297943ybx; Mon, 11 Nov 2019 07:04:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwH+boaAbOgfOSH75r/FsqaykjN6jbrfHBMi9k74mQOGBIUxV4GOCnf0+2enhZqUjJsciGG X-Received: by 2002:a17:906:f0c9:: with SMTP id dk9mr23272907ejb.56.1573484674713; Mon, 11 Nov 2019 07:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573484674; cv=none; d=google.com; s=arc-20160816; b=w8aLB2oEjD0+KyFFx7dyuHpjY7drSYsIHMiLu0QVowFeyDNcGJCUFFAG3bTR6KSFek sxlT1lGt3fjO8GSTFiXL2U/GMrbENKWNiJhQAO8+RxVG7VR10e0BDio8B9WN/qqeuha5 BdH8wymUeOV07wWRCra4n2guU1yY/N6iSgzay2cHvN/RBUyggYOWf78XiFTW9bWP6cFx ryMvy5NG8oYY777QkohAs3n+kasklz92kUo6QcZl7h5QLsEMgbJhbUdG3ORvSyb+AqYQ e5P8Ui806iU9so/lYCdSmHc6535DDZ3ADHWCnIhOyyoKyqeZam2FVP/xXHIOWya0lEEb c8+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=/lyJlehl3SHL3cILoyZTYkZm+/0A3k7QAa57z5CMFPs=; b=a98rQCRNRM1XdWP30QQhWdRbw5iHMQgdB72ObEO2BLElzIE6c1zKczjYEhkmSuhURd pv3FPXMaSBiybhcMbP3HPB2y8fS7sf136pBK+TaPI3+mx9zzy7FoPjLd3404ngRPtia4 xp0NJ6B2ExZfpHSyOxPVbVY+FbQpAJiy6hoVKQtuciA6EAn/2Z6NP69P4uWt61bgwWYs o5mbSjntWFWGkkk7IrIV1vIOz/m8RIymppn05g5vnVpy1z4csM0b6Pojegnu9mUM8HMx ZvZwGzTwHYGmck8+QEFvucZq8VpnYwhucDipJjJLQnz7isPCYtXatna0A+VKY735rZ/l pB/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UtnDIhai; 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=pass (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 o12si9686170edv.43.2019.11.11.07.04.09; Mon, 11 Nov 2019 07:04:34 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UtnDIhai; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726955AbfKKPDY (ORCPT + 99 others); Mon, 11 Nov 2019 10:03:24 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:60054 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726888AbfKKPDY (ORCPT ); Mon, 11 Nov 2019 10:03:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573484603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/lyJlehl3SHL3cILoyZTYkZm+/0A3k7QAa57z5CMFPs=; b=UtnDIhaiYGW6Xq1ftX1xYrogHdC375XfeuoTshI0iXSGa58BuwLCuA+roGY39APpjtc6Mj xyT63N7dIkraMhk/Kfm32+zqLiPcuz4Lbzh3aqRkWG+bgV5c9iSmSQJuLAsr21cIPtKT+d CTHBT4Pt09l9AncLBS4yKd7L2WSJFDE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-oVSFwkg6M_O6eCXYgu36-g-1; Mon, 11 Nov 2019 10:03:20 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65813800C61; Mon, 11 Nov 2019 15:03:18 +0000 (UTC) Received: from oldenburg2.str.redhat.com (dhcp-192-200.str.redhat.com [10.33.192.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 493CB52F3; Mon, 11 Nov 2019 15:03:13 +0000 (UTC) From: Florian Weimer To: "Michael Kerrisk \(man-pages\)" Cc: Christian Brauner , lkml , linux-man , Kees Cook , Oleg Nesterov , Arnd Bergmann , David Howells , Pavel Emelyanov , Andrew Morton , Adrian Reber , Andrei Vagin , Linux API , Jann Horn Subject: Re: For review: documentation of clone3() system call References: Date: Mon, 11 Nov 2019 16:03:11 +0100 In-Reply-To: (Michael Kerrisk's message of "Fri, 25 Oct 2019 18:59:31 +0200") Message-ID: <87tv7awj4g.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: oVSFwkg6M_O6eCXYgu36-g-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Michael Kerrisk: > Another difference for the raw clone() system call is that the > stack argument may be NULL, in which case the child uses a dupli= =E2=80=90 > cate of the parent's stack. (Copy-on-write semantics ensure that > the child gets separate copies of stack pages when either process > modifies the stack.) In this case, for correct operation, the > CLONE_VM option should not be specified. (If the child shares the > parent's memory because of the use of the CLONE_VM flag, then no > copy-on-write duplication occurs and chaos is likely to result.) I think sharing the stack also works with CLONE_VFORK with CLONE_VM, as long as measures are taken to preserve the return address in a register. Thanks, Florian