Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lhums9t7ej1.fsf@oldenburg.str.redhat.com>
Date: Fri, 27 Jun 2025 10:52:02 +0200
From: Florian Weimer <fweimer@...hat.com>
To: Alejandro Colomar <alx@...nel.org>
Cc: libc-alpha@...rceware.org,  bug-gnulib@....org,
  musl@...ts.openwall.com,  наб
 <nabijaczleweli@...ijaczleweli.xyz>,
  Douglas McIlroy <douglas.mcilroy@...tmouth.edu>,  Paul Eggert
 <eggert@...ucla.edu>,  Robert Seacord <rcseacord@...il.com>,  Elliott
 Hughes <enh@...gle.com>,  Bruno Haible <bruno@...sp.org>,  JeanHeyd
 Meneide <phdofthehouse@...il.com>,  Rich Felker <dalias@...c.org>,
  Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>,  Joseph Myers
 <josmyers@...hat.com>,  Laurent Bercot <ska-dietlibc@...rnet.org>,
  Andreas Schwab <schwab@...e.de>,  Thorsten Glaser <tg@...bsd.de>,  Eric
 Blake <eblake@...hat.com>,  Vincent Lefevre <vincent@...c17.net>,  Mark
 Harris <mark.hsj@...il.com>,  Collin Funk <collin.funk1@...il.com>,  Wilco
 Dijkstra <Wilco.Dijkstra@....com>,  DJ Delorie <dj@...hat.com>,  Cristian
 Rodríguez <cristian@...riguez.im>,  Siddhesh Poyarekar
 <siddhesh@...plt.org>,  Sam James <sam@...too.org>,  Mark Wielaard
 <mark@...mp.org>,  "Maciej W. Rozycki" <macro@...hat.com>,  Martin Uecker
 <ma.uecker@...il.com>,  Christopher Bazley <chris.bazley.wg14@...il.com>,
  eskil@...ession.se,  Daniel Krügler
 <daniel.kruegler@...glemail.com>,
  Kees Cook <keescook@...omium.org>,  Valdis Klētnieks
 <valdis.kletnieks@...edu>
Subject: Re: alx-0029r5 - Restore the traditional realloc(3) specification

* Alejandro Colomar:

> It would be good to have explicit replies by glibc maintainers about it,
> so that the C Committee understands better what the maintainers think
> about it.  I've got word from some committee members that if I can
> convince the maintainers, they'll vote for standardizing it.  So, it
> would be great it people could emit 'Acked-by:' tags, or otherwise
> explain their position.

This is not how ISO standardization works.  In the end, it comes down to
how the national bodies vote.

I think the proposal is not clear about its intent.  It looks to me you
are trying to accomplish at least the following things:

  * all allocation functions can be used to allocate zero-sized objects
  * calloc, reallocarray can be used to allocate arbitrary large arrays
    of zero-sized objects
  * calloc, reallocarray  can be used to allocate zero-length arrays
    of arbitrarily-sized objects
  * realloc, reallocarray can no longer be used to deallocate storage

If you frame your proposal in terms of aligning with traditional
behavior, you are inviting a discussion what the traditional behavior
is.  But this doesn't really matter.

I'm not sure if your changes to the calloc, reallocarray are sufficient
text.  I assume we want full symmetry of the arguments because the
argument order in existing programs is not very consistent.  This
requires dropping the requirement that one of the arguments is an object
size (which rules out zero as a valid argument value).

>From an implementation perspective, we need clarification that the
allocation functions (except aligned_alloc) may reduce the alignment of
the returned pointer to a power of two greater or equal to the requested
size, for allocation sizes that are less than the fundamental alignment.
(Some existing implementations already do this today, in violation of
the standard.)

Thanks,
Florian

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.