From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id B04D13858C2C for ; Thu, 24 Mar 2022 11:25:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B04D13858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=49655 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1nXLaQ-0007uW-4a; Thu, 24 Mar 2022 11:25:02 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1nXLaP-000B4O-Pa; Thu, 24 Mar 2022 12:25:01 +0100 From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Subject: Re: [PATCH v2] linux: Fix __closefrom_fallback iterates until max int (BZ#28993) References: <20220324110907.169470-1-adhemerval.zanella@linaro.org> Date: Thu, 24 Mar 2022 12:25:01 +0100 In-Reply-To: <20220324110907.169470-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Thu, 24 Mar 2022 08:09:07 -0300") Message-ID: <87v8w3r3si.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2022 11:25:06 -0000 * Adhemerval Zanella via Libc-alpha: > The __closefrom_fallback tries to get a available file descriptor > if the initial open ("/proc/self/fd/", ...) fails. It assumes the > failure would be only if procfs is not mount (ENOENT), however if > the the proc file is not accessible (due some other kernel filtering > such apparmor) it will iterate over a potentially large file set > issuing close calls. > > It should only try the close fallback if open returns EMFILE. I disagree. If there are performance issues due to the current code, people should fix their container hosts.