public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fw@deneb.enyo.de>,
	Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] linux: Fix __closefrom_fallback iterates until max int (BZ#28993)
Date: Thu, 24 Mar 2022 08:29:24 -0300	[thread overview]
Message-ID: <2a6ee621-1d00-7657-0248-0c3eb988aa9c@linaro.org> (raw)
In-Reply-To: <87v8w3r3si.fsf@mid.deneb.enyo.de>



On 24/03/2022 08:25, Florian Weimer wrote:
> * 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.

For closefrom it will trigger a __foritfy_fail and for
posix_spawn_file_actions_addclosefrom_np it will make posix_spawn fail.
I think on both cases it is better to fail early.

      reply	other threads:[~2022-03-24 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 11:09 Adhemerval Zanella
2022-03-24 11:19 ` Andreas Schwab
2022-03-24 11:25 ` Florian Weimer
2022-03-24 11:29   ` Adhemerval Zanella [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=2a6ee621-1d00-7657-0248-0c3eb988aa9c@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fw@deneb.enyo.de \
    --cc=libc-alpha@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).