From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 85BDA383301F; Wed, 16 Dec 2020 17:07:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85BDA383301F From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/10353] Methods for deleting all file descriptors greater than given integer (closefrom) Date: Wed, 16 Dec 2020 17:07:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: adhemerval.zanella at linaro dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: bug_status assigned_to Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 17:07:26 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D10353 Adhemerval Zanella changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at sourceware dot org |adhemerval.zanella = at linaro dot o | |rg --- Comment #23 from Adhemerval Zanella --- (In reply to Cristian Rodr=C3=ADguez from comment #21) > The linux kernel now has a close_range system call for this purpose. It > would be cool if glibc can provide both a syscall wrapper for close_range > *AND* closefrom implemented on top close_range in the linux target. The close_range seems a sensible addition to added as a syscall wrapper for Linux, without any extra fallback, and returning ENOSYS on older kernel (as= for copy_file_range). From Florian message, he should be ok with a fallback to /proc/self/fd if the syscall is not available; but this will make function = not fail-safe and add possible issues (as it was usual for multiple syscall fallbacks we added previosuly). I also agree that closefrom shouldbe added as a GNU extension, multiple sys= tem have added it. For posix_spawn extension, I think we can add a /proc/self/fd fallback that sets FD_CLOEXEC for each; the spawn will fail if it can not be executed and= it is allowed by the interface. --=20 You are receiving this mail because: You are on the CC list for the bug.=