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=-3.8 required=3.0 tests=BAYES_00, 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 2DF19C4363A for ; Thu, 29 Oct 2020 15:39:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA8F4207DE for ; Thu, 29 Oct 2020 15:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728282AbgJ2PjC (ORCPT ); Thu, 29 Oct 2020 11:39:02 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:33837 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727290AbgJ2PjC (ORCPT ); Thu, 29 Oct 2020 11:39:02 -0400 Received: from ip5f5af0a0.dynamic.kabel-deutschland.de ([95.90.240.160] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kYA0y-0001lI-6a; Thu, 29 Oct 2020 15:39:00 +0000 Date: Thu, 29 Oct 2020 16:38:59 +0100 From: Christian Brauner To: Giuseppe Scrivano Cc: linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, containers@lists.linux-foundation.org Subject: Re: [PATCH v2 0/2] fs, close_range: add flag CLOSE_RANGE_CLOEXEC Message-ID: <20201029153859.numo2fc42vgf3ppk@wittgenstein> References: <20201019102654.16642-1-gscrivan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201019102654.16642-1-gscrivan@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Oct 19, 2020 at 12:26:52PM +0200, Giuseppe Scrivano wrote: > When the new flag is used, close_range will set the close-on-exec bit > for the file descriptors instead of close()-ing them. > > It is useful for e.g. container runtimes that want to minimize the > number of syscalls used after a seccomp profile is installed but want > to keep some fds open until the container process is executed. > > v1->v2: > * move close_range(..., CLOSE_RANGE_CLOEXEC) implementation to a separate function. > * use bitmap_set() to set the close-on-exec bits in the bitmap. > * add test with rlimit(RLIMIT_NOFILE) in place. > * use "cur_max" that is already used by close_range(..., 0). I'm picking this up for some testing, thanks Christian