[musl] Re: Tweaking the program name for <err.h> functions

enh enh at google.com
Mon Mar 11 20:39:22 UTC 2024


On Mon, Mar 11, 2024 at 1:09 PM Skyler Ferrante (RIT Student)
<sjf5462 at rit.edu> wrote:
>
> Yup, I agree. My confusion was from an incorrect assumption that
> non-suid / suid programs would be handled the same way. I knew that
> strace wouldn't keep it setuid by I didn't realize glibc only checked
> closed fds for suid programs (which makes sense, this doesn't matter
> for non-privileged programs).
>
> > application erroneously closes fd 2
>
> And hopefully no program does that, and if it does, that's their fault :)

programs get confused about fds and close the wrong ones all the time.
the fd equivalent of a malloc() double-free especially. bionic has a
fairly general protection against this class of error:
https://android.googlesource.com/platform/bionic/+/master/docs/fdsan.md

(fork() children do it on purpose all the time too :-) )

> Skyler


More information about the libbsd mailing list