lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <whzecqawauwsoiaydpxsdgt55nmyi4tp5dgzvewmf4pinstdtq@z3kkqwdvscyi>
Date: Fri, 26 Sep 2025 11:00:10 +0200
From: Alejandro Colomar <alx@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, Kees Cook <kees@...nel.org>, 
	Christopher Bazley <chris.bazley.wg14@...il.com>, Rasmus Villemoes <linux@...musvillemoes.dk>, 
	Marco Elver <elver@...gle.com>, Michal Hocko <mhocko@...e.com>, 
	Linus Torvalds <torvalds@...ux-foundation.org>, Al Viro <viro@...iv.linux.org.uk>, 
	Alexander Potapenko <glider@...gle.com>, Dmitry Vyukov <dvyukov@...gle.com>, Jann Horn <jannh@...gle.com>
Subject: Re: [PATCH v1 0/3] Add ENDOF(), and use it to fix off-by-one bugs

Hi Andrew,

On Thu, Sep 25, 2025 at 01:48:14PM -0700, Andrew Morton wrote:
> On Thu, 25 Sep 2025 15:20:28 +0200 Alejandro Colomar <alx@...nel.org> wrote:
> 
> > I've split some of the patches from the string patch set, as these are
> > obvious bug fixes that are trivial to accept.
> > 
> > I've reset the version number of the patch set to 1, to not conflict
> > with the version numbering of the string series.
> 
> fyi, there's nothing here which is usable in an introductory [0/N]
> cover letter.
> 
> Documentation/process/submitting-patches.rst should explain the
> conventions here, but it is presently silent.
> 
> The [0/N] is an overview of the whole patchset - why it was created,
> what value it provides to our users and perhaps to kernel developers
> themselves.  It discusses alternative approaches, possible drawbacks,
> prior work, all that stuff.  And it provides a high-level description
> of the proposed implementation,
> 
> Potentially lots of words, and it's quite important.  In the case of
> your patchset, it's one short sentence (sorry).
> 
> The words you did include are short-term development things, unsuitable
> for inclusion in the permanent kernel record.

Thanks!  I'll keep it in mind.  BTW, I didn't know the cover letters
were stored anywhere.  By 'the permanent kernel record' you mean that
cover letters are stored in a merge commit message or something like
that?  It would be useful to have that documented.  I didn't know.

I can send a v2 with a better cover letter, if you want.

>  Such material *is*
> important and useful, but should be added after the "^---$" separator,
> to tell everyone that this material isn't for permanent inclusion.

Okay, I'll keep that in mind.

> Patchset seems reasonable, I guess.  But I'm not loving "ENDOF".  End
> of what - is that like __etext?  "ARRAY_END" matches "ARRAY_SIZE" quite
> nicely, no?  And it much better describes what the thing does.

ENDOF() matches countof(), which is the standard name for ARRAY_SIZE().

<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3550.pdf#subsubsection.0.6.5.4.5>
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3550.pdf#section.0.7.21>

I've never loved ARRAY_SIZE, as I have a macro sizeof_array() which
gives me the size of an array in bytes (and guarantees that the input is
an array).  The name nelementsof() --or the shorter NELEMS()-- seems
more appropriate, IMO, since what it returns is "the number of elements
of an array".  However, the C Committee hated it so much that I couldn't
get them to standardize it.  I'm content enough with countof().


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ