Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp848248ybz; Wed, 22 Apr 2020 09:02:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKnEX7R66m5gkCcXbY6V+yTk4cMdVVu1gSSDSdKgqnIyReprEATCXpRoOnEEMIryvtrWPnN X-Received: by 2002:a05:6402:3129:: with SMTP id dd9mr10775438edb.121.1587571361880; Wed, 22 Apr 2020 09:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587571361; cv=none; d=google.com; s=arc-20160816; b=MvIJgm8jTuHBE9OsEfX/VTX5ydr22Pp/UdrCdql9Y6uViP/HhYTv8283LFO4T9BJMz wC/+YT+Fem3Y5AjM58a+hwlyA8zZar8STqDSe04IbLxDEwi7m26pQOtpCbEbwyDdR3QC i1rAr+QXgKs2JP9AmTAD6/wUiIo0wMSkca3qqp6DAjt80Ytw1lNLSPL4Su0yW7wH5iBn B7P8mwQAxux8j6oPYmWDaFYVymC4GDTv2kaffKYIzbKuJbqrfC7eDGKrXav06tPpf4Dw 9pqiPWKqoa+bgQde3qb0YukRMNBTRKbwLu2HaMaju11VbldKS8OJQqvjnKmhzQB364uD 08sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LDaUq69ZQC2N0ppSa9cxDgdCbL6jwhM3xdIlMM1P1Dw=; b=xSGbVJF1ldsfg4d4IKc577FjBrE6LKMMf0KsxSo/Jdam86F5mOn+qi+0IsxFMzwiQz rw4dTXQryuqj+l4zJNSbT9EbdwDCulwF3QemM5J/U//vLOQHmIs8g5+eI3hI7Df1gYbL ob6VgpL/RHyvi+auQTJA8sE0f6vznU/fFAZ/31Tt9ogYuGsNZe5trwuqiJ7vQcw6ujif Pg6BJX9se6VmsY/DQGesnF+Rnjxf6wazyOhWSGJ5ElyhxR7LK4taSEqT9L1g2NCTqWGD WvlzMpAgSq4JaG3vfBaoOWU+tFiiWKmTCZGfErlfruiOcLED942heau0f224W+koZNMH uIHg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si3748754edm.270.2020.04.22.09.02.16; Wed, 22 Apr 2020 09:02:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726403AbgDVQBI (ORCPT + 99 others); Wed, 22 Apr 2020 12:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgDVQBH (ORCPT ); Wed, 22 Apr 2020 12:01:07 -0400 X-Greylist: delayed 3563 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 22 Apr 2020 09:01:07 PDT Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B466C03C1A9; Wed, 22 Apr 2020 09:01:07 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRHnc-008Yo8-Vd; Wed, 22 Apr 2020 16:00:33 +0000 Date: Wed, 22 Apr 2020 17:00:32 +0100 From: Al Viro To: Matthew Wilcox Cc: Nate Karstens , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , "James E.J. Bottomley" , 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 Subject: Re: Implement close-on-fork Message-ID: <20200422160032.GL23230@ZenIV.linux.org.uk> References: <20200420071548.62112-1-nate.karstens@garmin.com> <20200422150107.GK23230@ZenIV.linux.org.uk> <20200422151815.GT5820@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422151815.GT5820@bombadil.infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 08:18:15AM -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.html > might be useful *snort* Alan Coopersmith in that thread: || https://lwn.net/Articles/785430/ suggests AIX, BSD, & MacOS have also defined || it, and though it's been proposed multiple times for Linux, never adopted there. Now, look at the article in question. You'll see that it should've been "someone's posting in the end of comments thread under LWN article says that apparently it exists on AIX, BSD, ..." The strength of evidence aside, that got me curious; I have checked the source of FreeBSD, NetBSD and OpenBSD. No such thing exists in either of their kernels, so at least that part can be considered an urban legend. As for the original problem... what kind of exclusion is used between the reaction to netlink notifications (including closing every socket, etc.) and actual IO done on those sockets?