[PATCH v2] linux: Fix __closefrom_fallback iterates until max int (BZ#28993)
Florian Weimer
fw@deneb.enyo.de
Thu Mar 24 11:25:01 GMT 2022
* 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.
More information about the Libc-alpha
mailing list