From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4AB2B385840A; Mon, 27 Sep 2021 13:18:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AB2B385840A From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/28377] closefrom_fallback fails when /proc/self/fd is not present, which causes unexpected behavior with openssh Date: Mon, 27 Sep 2021 13:18:55 +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: 2.34 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Mon, 27 Sep 2021 13:18:55 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28377 Adhemerval Zanella changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adhemerval.zanella at lina= ro dot o | |rg --- Comment #2 from Adhemerval Zanella --- As Florian has state in the https://bugzilla.mindrot.org/show_bug.cgi?id=3D= 3349, there is not much we can do make it work reliable on Linux. The RLIMIT_NOFI= LE fallback some implementations (such the one used on openssh at openbsd-compat/bsd-closefrom.c) is not possible because it does not really describe the descriptor range, and iterating over all possible file descrip= tors values (INT_MAX) is prohibitively performance-wise. It might work on openssh since it controls when and how it uses RLIMIT_NOFILE, but it not an option = for glibc. So I think it is a fair assumption that if you want to support closefrom() = on a kernel without the syscall suppport, you need to provide the another feasib= le kernel interface to allows it (procfs). Another option is to either abort if /proc can not be opened or remove the fallback (and abort() as well). In any case, I am inclined to close this bug. --=20 You are receiving this mail because: You are on the CC list for the bug.=