Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240611193933.GH3766212@port70.net>
Date: Tue, 11 Jun 2024 21:39:33 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: Stefan Jumarea <stefanjumarea02@...il.com>
Cc: Rich Felker <dalias@...c.org>, musl@...ts.openwall.com
Subject: Re: [PATCH] mallocng: Add MTE support for Aarch64

* Stefan Jumarea <stefanjumarea02@...il.com> [2024-06-11 20:13:28 +0300]:

> On Tue, Jun 11, 2024 at 12:42:22PM -0400, Rich Felker wrote:
> > On Tue, Jun 11, 2024 at 06:37:11PM +0300, Stefan Jumarea wrote:
> > > On Tue, Jun 11, 2024 at 10:46:25AM -0400, Rich Felker wrote:
> > > > On Tue, Jun 11, 2024 at 04:09:22PM +0200, Szabolcs Nagy wrote:
> > > > > * Stefan Jumarea <stefanjumarea02@...il.com> [2024-06-10 15:36:25 +0300]:
> > > 
> > > This was done since MTE has a 16 byte granule for tagging.
> > > Makes more sense to do this where the class is selected, yes. I'm not
> > > sure about making it work for smaller allocations, I'll try to think of
> > > a way to cover that.
> > 
> > Is there any way to perform a "load, ignoring tag mismatch" operation?
> > 
> 
> Yes, there is the `ldg` instruction that can load the tag of a given
> address, so we can use that.
> 

there is no atomic load with tag ignored. ldg+ld works if you know the
memory tag cannot change asynchronously.

writing to the tco register can disable (and then enable) tag checks
(see the linux docs).

i think it's a bad idea to share the same 16byte granule between user
allocation and in-band malloc meta data for the next allocation,
the two can be independently freed and thus the tag of the granule
can change asynchronously when accessed. and using tco to access the
in-band data might have overheads.

moving the in-band meta data to another granule is imho the right
solution but it costs more space than the compact mallocng design.

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.