Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260513131936.GL1827@brightrain.aerifal.cx>
Date: Wed, 13 May 2026 09:19:36 -0400
From: Rich Felker <dalias@...c.org>
To: Jₑₙₛ Gustedt <jens.gustedt@...ia.fr>
Cc: Florian Schmaus <florian.schmaus@...asip.com>, musl@...ts.openwall.com,
	tg@...bsd.de
Subject: Re: [PATCH v2] qsort: align 'tmp' buffer to preserve CHERI
 capabilities

On Wed, May 13, 2026 at 11:17:17AM +0200, Jₑₙₛ Gustedt wrote:
> Florian,
> 
> on Wed, 13 May 2026 10:21:46 +0200 you (Florian Schmaus
> <florian.schmaus@...asip.com>) wrote:
> 
> > ...
> 
> > By changing the buffer type to a union with a pointer member we force
> > the compiler to align the stack allocation to the architectural
> > pointer/capability alignment boundary. This ensures that capabilities
> > stored in the buffer retain their tags and remain valid.
> 
> wouldn't it be simpler to us `_Alignas`? There seem already some
> usages of that feature in musl, so that should not be a problem, I
> guess.

musl is written in C99 plus a minimum set of extensions, and I don't
expect this to change. It's an important part of bootstrappability and
nonmonoculture goals.

The only use of alignment directives we have now should be in headers
for archs (and IIRC one Linux kernel interface) where it's necessarily
part of the ABI.

Rich

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.