From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Cc: Jonathon Anderson <janderson@rice.edu>,
Adhemerval Zanella <adhemerval.zanella@linaro.org>,
John Mellor-Crummey <johnmc@rice.edu>
Subject: Re: [PATCH v6 4/5] io: Add closefrom [BZ #10353]
Date: Tue, 06 Jul 2021 13:37:08 +0200 [thread overview]
Message-ID: <874kd7hdwb.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <f58c689d-2b33-3e1a-5357-24d0c08105e3@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Mon, 5 Jul 2021 17:26:37 -0300")
* Adhemerval Zanella via Libc-alpha:
> Valgrind can overwrite it because it make is invisible to user program and
> libc, and for your tool I think the best course of action would be to
> interpose closefrom() and clone_range() and exclude the file descriptors
> you want to keep it opened.
I agree.
Just to be clear: glibc will not clean up descriptors behind the
application's back. The application has to request that, so interposing
the call should be sufficient for your purposes.
(We even have a policy of not opening long-term file descriptors for
internal use because we know that extra file descriptors confuse many
applications.)
Thanks,
Florian
next prev parent reply other threads:[~2021-07-06 11:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 18:51 [PATCH v6 0/5] Add close_range, closefrom, and posix_spawn_file_actions_closefrom_np Adhemerval Zanella
2021-06-23 18:51 ` [PATCH v6 1/5] support: Add support_stack_alloc Adhemerval Zanella
2021-06-24 9:15 ` Florian Weimer
2021-06-24 11:33 ` Adhemerval Zanella
2021-06-23 18:51 ` [PATCH v6 2/5] support: Add xclone Adhemerval Zanella
2021-06-24 9:15 ` Florian Weimer
2021-06-23 18:51 ` [PATCH v6 3/5] linux: Add close_range Adhemerval Zanella
2021-06-27 17:23 ` Florian Weimer
2021-06-23 18:51 ` [PATCH v6 4/5] io: Add closefrom [BZ #10353] Adhemerval Zanella
2021-07-03 14:45 ` Jonathon Anderson
2021-07-05 20:26 ` Adhemerval Zanella
2021-07-06 11:37 ` Florian Weimer [this message]
2021-06-23 18:51 ` [PATCH v6 5/5] posix: Add posix_spawn_file_actions_closefrom_np Adhemerval Zanella
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=874kd7hdwb.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=adhemerval.zanella@linaro.org \
--cc=janderson@rice.edu \
--cc=johnmc@rice.edu \
--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).