From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: DJ Delorie <dj@redhat.com>, Sam James <sam@gentoo.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [RFC] Supporting malloc_usable_size
Date: Fri, 2 Dec 2022 07:36:18 -0500 [thread overview]
Message-ID: <fc068ac7-0549-352e-d6ab-29b139cc07db@gotplt.org> (raw)
In-Reply-To: <xn8rjq74sa.fsf@greed.delorie.com>
On 2022-12-02 00:28, DJ Delorie wrote:
> Sam James <sam@gentoo.org> writes:
>> Right. It's still not clear to me if glibc is actually interested in supporting
>> the use case here. If it isn't, it should be stated clearly so it's clear
>> who is to blame when FORTIFY_SOURCE=3 complains.
>
> I don't think it's up to glibc to support a "use case" per se. The API
> does what is documented, no more, no less. As long as we function
> "correctly", the users can abuse that functionality all they want. My
> opinion is just that, when they do that, it's up to them to make sure
> their abuse plays well with other tools, like gcc and FORTIFY_SOURCE=3.
>
> Hence my focus on documentation.
>
> We can document what the APIs do.
>
> We can provide a tutorial that helps people understand how the APIs work
> together in a "best practices" way.
>
> We can list caveats that document whar be dragons.
>
> Beyond that, caveat programmer.
Thanks, from your and Sam's comments, one thing I can be sure of is that
I (as glibc maintainer) should not be the one suggesting hacks that add
some measure of safety to this use since that then may get misconstrued
as endorsement by the glibc project. It has happened before:
https://github.com/systemd/systemd/issues/22801#issuecomment-1073962482
Besides, both Andreas and Florian pointed out ways in which such
malloc_usable_size could be unsafe despite current definitions, so that
is further reason to not support this use case.
On to the alternative question then; given that the interface has
minimal utility, unnecessarily exposes internal implementation caveats
and is prone to abuse, does it make sense to deprecate it? If not, does
it make sense to make the note in the man page stronger by, e.g.
removing the "without ill effects" and discourage its use for anything
other than diagnostics?
Thanks,
Sid
next prev parent reply other threads:[~2022-12-02 12:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 21:32 [RFC] Supporting malloc_usable_size Siddhesh Poyarekar
2022-12-02 4:42 ` DJ Delorie via Libc-alpha
2022-12-02 5:00 ` Sam James via Libc-alpha
2022-12-02 5:28 ` DJ Delorie via Libc-alpha
2022-12-02 12:36 ` Siddhesh Poyarekar [this message]
2022-12-02 19:16 ` DJ Delorie via Libc-alpha
2022-12-02 19:49 ` Siddhesh Poyarekar
2022-12-02 19:57 ` DJ Delorie via Libc-alpha
2022-12-02 12:03 ` Andreas Schwab
2022-12-02 12:22 ` Siddhesh Poyarekar
2022-12-02 12:34 ` Andreas Schwab
2022-12-02 12:39 ` Florian Weimer via Libc-alpha
2022-12-05 18:46 ` Zack Weinberg via Libc-alpha
2022-12-05 19:04 ` Siddhesh Poyarekar
2022-12-05 20:35 ` Florian Weimer via Libc-alpha
2022-12-06 19:25 ` Siddhesh Poyarekar
2022-12-07 10:01 ` Florian Weimer via Libc-alpha
2022-12-07 16:34 ` Siddhesh Poyarekar
2022-12-07 16:54 ` Adhemerval Zanella Netto via Libc-alpha
2022-12-07 16:57 ` Sam James via Libc-alpha
2022-12-07 17:39 ` Florian Weimer via Libc-alpha
2022-12-09 15:42 ` Siddhesh Poyarekar
2022-12-07 18:45 ` DJ Delorie via Libc-alpha
2022-12-02 12:54 ` Florian Weimer via Libc-alpha
-- strict thread matches above, loose matches on Subject: below --
2022-12-02 13:54 Wilco Dijkstra via Libc-alpha
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc068ac7-0549-352e-d6ab-29b139cc07db@gotplt.org \
--to=siddhesh@gotplt.org \
--cc=dj@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=sam@gentoo.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).