Subject: Re: bug#43415: coreutils 8.32: install: fchmod fails with EBADF

From: Paul Eggert <[email-masked]>
Date: Tue, 15 Sep 2020 16:49:04 -0700

On 9/14/20 6:31 PM, Cameron Nemo via GNU coreutils Bug Reports wrote:
> It seems like relying on the /proc link is not ideal,
> and a bug is being hidden by such behavior.
> Is there any chance that this can be resolved?

It really should be fixed in the Linux kernel: it needs a proper way to 
implement POSIX fchmodat <https://pubs.opengroup.org/onlinepubs/9699919799/> 
with the AT_SYMLINK_NOFOLLOW flag, in order to plug some security holes 
involving symlink attacks. See:

https://bugzilla.redhat.com/show_bug.cgi?id=1810141
https://lkml.org/lkml/2020/6/9/548

In the meantime, mounting /proc may be your best bet. I vaguely recall there are 
other places in glibc that assume /proc.