Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp630575ybk; Fri, 15 May 2020 09:28:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIq993cD/0RZSWS4dD9a7DuEfcCzmVUmsqHDdO38fOQunoHsmUzpDLK3fxnHFqGfmnAqgc X-Received: by 2002:a50:f610:: with SMTP id c16mr3791840edn.175.1589560101749; Fri, 15 May 2020 09:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589560101; cv=none; d=google.com; s=arc-20160816; b=fw4QabMHxy9En3bDxjxPruEq7PcXToxHWL+p8cDDIAtI8tv6TS6qXK+uw7hIECZRL+ CUF1Ss5sYj6HZYaxYs7CPuJdIU/XmN5fnyBA1RY6ia2pa4A3oRXKsoja/Si82YUeRwcZ 3FmBD/mrYuqDbY4EN0UsV5FiAn5AbLOrO2n02Q480J+a3r+MqDAsM2PtS4B9MBoQqoa0 3eq5U23lSe3PsAwmtzpHzXlzObW6DBYIpgSpMU8wi7IMW0A7oFwdHQGcfrI5wX0FUT6d L7BCusfPSLGRwSjuroWd64fMgXkOXUeKlSv6ODgt6XSyR4p4avod63fOngCSErfQE76e xktA== 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 :dkim-signature; bh=5gAtDZQTZJyIz4lJd56+m7fpDX/8eOny8zsjfp/WK3g=; b=YljlGMmXPTWbzJrrH4aWJYj3XpO3u6E3vQ6nbSDIHj3UcYUP577fKQzH1A0ufPWr6r idJgd60mK5Tm5d0E6ZCcnLWVl6eQog4zfm0Ac/j8+NmgdVOknx1iZCtie5LLv9ioEujb zlIthuLxYnLoDJd2VAvtG2CC7kR+N42v9jULdzyz0dSze31yh9GWWcqH6+tNWlQW+x2k 55Mdg//CJXQJ/JEbLHT/hgIo08/alV09bu0KpI3H8bSu+qPlOFrf+NY1KIK+QqsNu3jS kT79w8dcEnoRmh2CkuEex4qQ5Zl5rFUMgcpwfC2ZyFvjjtwWo7soPzc3CFuIc/IjF5m3 9D1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=E1GnXv9H; 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 o3si1568184edb.156.2020.05.15.09.27.59; Fri, 15 May 2020 09:28:21 -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=@infradead.org header.s=bombadil.20170209 header.b=E1GnXv9H; 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 S1726660AbgEOQ0b (ORCPT + 99 others); Fri, 15 May 2020 12:26:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726162AbgEOQ0a (ORCPT ); Fri, 15 May 2020 12:26:30 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56BA2C061A0C; Fri, 15 May 2020 09:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5gAtDZQTZJyIz4lJd56+m7fpDX/8eOny8zsjfp/WK3g=; b=E1GnXv9HQmw3mxGy8aTAUkpqtO LX32SHoo6haT7C848Uk/mHhzb1Mi82vSzLqaqXMBeLxEoQreda9IbySpK9JiyNlQPchRwdvkB89TG cJ+ZIchO992dspfvL0oC6jojurfVU/cfECKy6b4WDO00Ad0indEJ6GElFVlP+vOsnr+pa4Me57i7o v0sl4fV4SdGx6yYezqRxl2STkyRwP+/LAThK7MDh1/uODW/aPFO3hJ7EO4jZogC7UkCBb7PIQyyo7 VSmbm9T/M6YK8TtNYQtmwZP0KvbGfMxmwFDJlq3T7aof9Iy3/oiBMvZzpJb53+gP62xcqiXEXouOd 2uN/J65w==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZdAA-00076j-WE; Fri, 15 May 2020 16:26:19 +0000 Date: Fri, 15 May 2020 09:26:18 -0700 From: Matthew Wilcox To: "Karstens, Nate" Cc: Alexander Viro , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , "James E.J. Bottomley" , Helge Deller , "David S. Miller" , Jakub Kicinski , Eric Dumazet , David Laight , "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 , "a.josey@opengroup.org" Subject: Re: [PATCH v2] Implement close-on-fork Message-ID: <20200515162618.GG16070@bombadil.infradead.org> References: <20200515152321.9280-1-nate.karstens@garmin.com> <20200515155730.GF16070@bombadil.infradead.org> <5b1929aa9f424e689c7f430663891827@garmin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5b1929aa9f424e689c7f430663891827@garmin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 04:07:33PM +0000, Karstens, Nate wrote: > Matthew, > > What alternative would you suggest? > > >From an earlier email: > > > ...nothing else addresses the underlying issue: there is no way to > > prevent a fork() from duplicating the resource. The close-on-exec > > flag partially-addresses this by allowing the parent process to > > mark a file descriptor as exclusive to itself, but there is still > > a period of time the failure can occur because the auto-close only > > occurs during the exec(). Perhaps this would not be an issue with > > a different process/threading model, but that is another discussion > > entirely. > > Do you disagree there is an issue? Yes. system() is defined as being unsafe for a threaded application to call. I pointed this out in the last thread.