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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00F66C38145 for ; Fri, 2 Sep 2022 17:21:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A0F68D002B; Fri, 2 Sep 2022 13:21:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34FB58D0014; Fri, 2 Sep 2022 13:21:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F0738D002B; Fri, 2 Sep 2022 13:21:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0D9518D0014 for ; Fri, 2 Sep 2022 13:21:02 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id CF111A03C4 for ; Fri, 2 Sep 2022 17:21:01 +0000 (UTC) X-FDA: 79867810722.19.0F179B6 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf04.hostedemail.com (Postfix) with ESMTP id 8C2F14005B for ; Fri, 2 Sep 2022 17:21:01 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id jm11so2432808plb.13 for ; Fri, 02 Sep 2022 10:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=iQbV94zcvm+miEj7HiKM+Lf+C2RI4FnBWdsgliuH+qI=; b=ArtbJSIjssgo6PSuE0VUvEGuZfZVxwOQvS63KtYr4bkZzK+d/nnhmqXO7YT56/R6Rg lFfbIL304JlWQ/kZms8CddAoygsd2P8g1kTnvLvZQuCfc82nO0rNuWcmOcO8bXUP6NeO sf65kXICgQ7cn4PuGjMwidQf9Rw4ge8c53Cbr7n1S1e8IwzyF8EKF5VGKGLMHihfv5AK oshKS0JRNzA4vmLjyfo7HIVjSJndBTOkyswmF5O3Br8v2kTcY8yzo9YeLZ5f8s/yRyVk JRinTZA+1UhDb8EaMZJnlYfvbMUOCQuODz1+xS5fFa40QMug19rFxzc78G2u+qB7Bthu mKIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=iQbV94zcvm+miEj7HiKM+Lf+C2RI4FnBWdsgliuH+qI=; b=T6xHf4uxq/+IEhuHoIB8s3xgm7JEna4nfheP+yGFthgtsQ+30SyHJDy5kN2ngkWlAs +dZ4G9tO9GS8Sq4za4GTfjETx2/AVOU+r2ozqXPh4uTCH+PJ3RoJdR9AZI8jB/Utraqo h6X2VL6U/DHne6S//1eVljb65vaWl4W4DVD6BMoM82lLwoPVV4LjhVhP4ridxignVLS+ W0uBHsN9Lqd2D1goz42tfTnj3uxA43a2AxCo2pyBzVVsX7E2F7/+/jNNesJZ3RrwYZni Zu5OaLfiyqNXKUT6kLfOkT+VtYpoPNydtGh2q8WjcSryy3y2nSZo4yMXzFZwvG+j6V70 gFuw== X-Gm-Message-State: ACgBeo1Mt2kaJ4e2b3aQot2/j5ArCxIL/1d7NoOUPCmVX0SIVPjxl25e vawhvCUgdAp7ykD5AYOMZu2TvdJnLtc= X-Google-Smtp-Source: AA6agR5YgYe8v48cg9VcdiYh6UwpYqzgBmOwNuY+6Rv7JAuD2W8ZkgXYvsCV90pF32VMdSMecw//Ng== X-Received: by 2002:a17:902:bd05:b0:172:ae77:1eea with SMTP id p5-20020a170902bd0500b00172ae771eeamr36296865pls.158.1662139260174; Fri, 02 Sep 2022 10:21:00 -0700 (PDT) Received: from gmail.com ([2601:600:8500:5f14:d627:c51e:516e:a105]) by smtp.gmail.com with ESMTPSA id z15-20020a170903018f00b00172a670607asm1909648plg.300.2022.09.02.10.20.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 10:20:59 -0700 (PDT) Date: Fri, 2 Sep 2022 10:20:57 -0700 From: Andrei Vagin To: Alexey Izbyshev Cc: "Eric W. Biederman" , Florian Weimer , Christian Brauner , Dmitry Safonov <0x7f454c46@gmail.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Kees Cook Subject: Re: Potentially undesirable interactions between vfork() and time namespaces Message-ID: References: <87czcfhsme.fsf@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662139261; a=rsa-sha256; cv=none; b=cCE9RscD5ySJbbVsiYaHeuDUmh22C3Q/IqsZMzNMDNdlZ8Cng92I/kOSJsH7O1h5jJb82p 7rshPUt1/AqYSL8K7/ti2lwgdnnCjMLJJBn3bwqdU8H0oF2YpHIoE+L7OyJ/dR7It3mR1u oj8EDbf6yqdJrrJOvngUrXPvhaQjmRI= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ArtbJSIj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of avagin@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=avagin@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662139261; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=iQbV94zcvm+miEj7HiKM+Lf+C2RI4FnBWdsgliuH+qI=; b=HQ0YdWqlX4kqPSd1vpfr/DZN2jiXIGuAdU/3FPfZnx0fCfsJ/V4107BRoqFYrBBQtRDet4 sNT4fRoEZzUjQze7qj65oNUeJ3f326GykM4JVaZHepOYdTR5Ut9e0gECwhl/HB2nUW9vrx Oj+me0o99TJaukAEDgTHUZUxOdv7l6w= X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 8C2F14005B Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ArtbJSIj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of avagin@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=avagin@gmail.com X-Rspam-User: X-Stat-Signature: red1zidpjq1h6ctx13bd8bp855intffy X-HE-Tag: 1662139261-945891 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Sep 02, 2022 at 07:39:28PM +0300, Alexey Izbyshev wrote: > > > @@ -2043,18 +2043,6 @@ static __latent_entropy struct task_struct > > > *copy_process( > > > return ERR_PTR(-EINVAL); > > > } > > > > > > - /* > > > - * If the new process will be in a different time namespace > > > - * do not allow it to share VM or a thread group with the forking > > > task. > > > - * > > > - * On vfork, the child process enters the target time namespace only > > > - * after exec. > > > - */ > > > - if ((clone_flags & (CLONE_VM | CLONE_VFORK)) == CLONE_VM) { > > > - if (nsp->time_ns != nsp->time_ns_for_children) > > > - return ERR_PTR(-EINVAL); > > > - } > > > > pls don't remove this part. It was one of the concerns that vfork > > doesn't work after unshare(CLONE_NEWTIME), but it is one of the standard > > ways of creating a new process. For example, posix_spawn uses it. > > > What do you mean? On the contrary, removing this restriction of the original > time namespace implementation allows vfork(), pthread_create() and the like, > solving the issue with posix_spawn() as well. > Sorry, I was not woken up completely and decided that it just reverted the change that allows vfork. Now, I see that it removes this restriction completely. So it looks good to me. Thanks, Andrei.