Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp822514ybz; Wed, 22 Apr 2020 08:36:02 -0700 (PDT) X-Google-Smtp-Source: APiQypIbzQ+99KzNNj4jdwpDWVUYFcbo7DjNcyk6OkRC9KY5e4KANZTiMD2xGHpTh8G2SBzaPabZ X-Received: by 2002:aa7:c5cf:: with SMTP id h15mr24220296eds.213.1587569761900; Wed, 22 Apr 2020 08:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587569761; cv=none; d=google.com; s=arc-20160816; b=v2QCIOCVcPo2wcr9Xsqkbcft8QtabIJ5a38MUsXAELggGGmyOfooZo2GJ+K6GhIWdv lequBOty+ZiP06913AfnEF1Ht/1F0PvXVcuWQGqAhlH+gno8qKEkq5cB1tmgETBjfeiC xKYFx3gJV99K9Bwl61Epxiao2fcZC6ShVu8BY7PPtGeQX9+eoNvBydUf80V0/nZTPALe ziPgJhh/4AusY6LXzYGBNNBMmA+84n+pYJWd0FmYxx+Fxj2QBLgwrDRArK+do2n7dfrY oXUBnxJ/+IMxmw13a5ITSoDVD9cMZW2s+WUGQleFCfbSrzND5331xfcdX0sei6//YKLf XjZQ== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature; bh=mL2uBLgBLEh9OgGf/nbGPULr+ZE7J2++MAWGTulwRyg=; b=yumZN2xjyJHXs2zRynR0BdYLB06p4RAidZco8DWXjghlwPlPhOyb0hwr4ef1sLHI2i +xqn+mu9BMDWOr3IhIrPwptSKgugNdCLbWkRIvNKteOjQ+P2rGL8IjLeFnYF7P6iTD97 Qdcn79lxPO4DpVXmeOf5F2FbIkUo6ZQ/6IvjtZMtE8wKGbuwgVM+s4NYPOqWUUQCVIDl yBVEdTCN/OwYRBTSJBIbQIhG8qNjpcCgFQfIh+nmMjjzsWGqSCkxZa/LWmJeBAJ52KP4 WeMYnAAFT4xKHNuGGVXwMhZ+pK4Tdzy9HB/dCDWekHYtIdjyeOtoC6BjLQbN+4i0HVo/ NZCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=PrBv5i4N; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=PrBv5i4N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si3689032ejb.118.2020.04.22.08.35.37; Wed, 22 Apr 2020 08:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=PrBv5i4N; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=PrBv5i4N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726501AbgDVPe1 (ORCPT + 99 others); Wed, 22 Apr 2020 11:34:27 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:58402 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726168AbgDVPe0 (ORCPT ); Wed, 22 Apr 2020 11:34:26 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 866D28EE19C; Wed, 22 Apr 2020 08:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1587569665; bh=4bdRD2Z19rQrjwriVaW9PfQmwVjc28+BZsVMjx2i8Hk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PrBv5i4NvrpBA8AnNmMReE20QVPztGgU72CBFUaFrCQwXLXAakN10ArYvrWADzCSw QcdGixmbSsellgvadaVGHAzYzyWNt7zGbMmXQpqSWYreMpWX8xxNwdvAYx/Tv3Haiu 5ZEQOlOR8iN4ViK1CPUhgCFIKaUrMO28SCsZL7MA= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id we20aduEjjM5; Wed, 22 Apr 2020 08:34:25 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.76.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 55FC88EE0CE; Wed, 22 Apr 2020 08:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1587569665; bh=4bdRD2Z19rQrjwriVaW9PfQmwVjc28+BZsVMjx2i8Hk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PrBv5i4NvrpBA8AnNmMReE20QVPztGgU72CBFUaFrCQwXLXAakN10ArYvrWADzCSw QcdGixmbSsellgvadaVGHAzYzyWNt7zGbMmXQpqSWYreMpWX8xxNwdvAYx/Tv3Haiu 5ZEQOlOR8iN4ViK1CPUhgCFIKaUrMO28SCsZL7MA= Message-ID: <1587569663.3485.18.camel@HansenPartnership.com> Subject: Re: Implement close-on-fork From: James Bottomley To: Matthew Wilcox , Al Viro Cc: Nate Karstens , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Helge Deller , "David S. Miller" , Jakub Kicinski , linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Changli Gao Date: Wed, 22 Apr 2020 08:34:23 -0700 In-Reply-To: <20200422151815.GT5820@bombadil.infradead.org> References: <20200420071548.62112-1-nate.karstens@garmin.com> <20200422150107.GK23230@ZenIV.linux.org.uk> <20200422151815.GT5820@bombadil.infradead.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-04-22 at 08:18 -0700, Matthew Wilcox wrote: > On Wed, Apr 22, 2020 at 04:01:07PM +0100, Al Viro wrote: > > On Mon, Apr 20, 2020 at 02:15:44AM -0500, Nate Karstens wrote: > > > Series of 4 patches to implement close-on-fork. Tests have been > > > published to https://github.com/nkarstens/ltp/tree/close-on-fork. > > > > > > close-on-fork addresses race conditions in system(), which > > > (depending on the implementation) is non-atomic in that it > > > first calls a fork() and then an exec(). > > > > > > This functionality was approved by the Austin Common Standards > > > Revision Group for inclusion in the next revision of the POSIX > > > standard (see issue 1318 in the Austin Group Defect Tracker). > > > > What exactly the reasons are and why would we want to implement > > that? > > > > Pardon me, but going by the previous history, "The Austin Group > > Says It's Good" is more of a source of concern regarding the > > merits, general sanity and, most of all, good taste of a proposal. > > > > I'm not saying that it's automatically bad, but you'll have to go > > much deeper into the rationale of that change before your proposal > > is taken seriously. > > https://www.mail-archive.com/austin-group-l@opengroup.org/msg05324.ht > ml > might be useful So the problem is an application is written in such a way that the time window after it forks and before it execs can cause a file descriptor based resource to be held when the application state thinks it should have been released because of a mismatch in the expected use count? Might it not be easier to rewrite the application for this problem rather than the kernel? Especially as the best justification in the entire thread seems to be "because solaris had it". James