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 X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5053C433E0 for ; Fri, 15 May 2020 16:26:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9478A2076A for ; Fri, 15 May 2020 16:26:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="E1GnXv9H" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726675AbgEOQ0b (ORCPT ); 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.