public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-28377-131-4TulHFgbvg@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28377-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28377

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
As Florian has state in the https://bugzilla.mindrot.org/show_bug.cgi?id=3349,
there is not much we can do make it work reliable on Linux. The RLIMIT_NOFILE
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 descriptors
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 feasible
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2021-09-27 13:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 22:35 [Bug libc/28377] New: " william.wilson at canonical dot com
2021-09-22 22:37 ` [Bug libc/28377] " william.wilson at canonical dot com
2021-09-22 23:07 ` michael.hudson at canonical dot com
2021-09-27 13:18 ` adhemerval.zanella at linaro dot org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28377-131-4TulHFgbvg@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).