This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFD - Support for memory tagging in GLIBC
- From: DJ Delorie <dj at redhat dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: Szabolcs dot Nagy at arm dot com, Richard dot Earnshaw at arm dot com, nd at arm dot com, libc-alpha at sourceware dot org
- Date: Tue, 10 Sep 2019 11:54:42 -0400
- Subject: Re: RFD - Support for memory tagging in GLIBC
Paul Eggert <eggert@cs.ucla.edu> writes:
> SPARC ADI has a 64-byte granule, and Richard's email said there could be an
> efficiency issue there since I assume malloc's block header is smaller than 64
> bytes.
The malloc overhead - in general - for allocated and in-use chunks - is
sizeof(void *).
However, the alignment requirements means that the smallest chunk we can
work with is typically 4*sizeof(void*) but that's *not* aligned to a
16-byte boundary! The *second* word (the start of the user area) is the
alignment point.
So it sounds like for ADI the chunk and its chunk header might be in
different granules, and the chunk header couldn't be protected from
buffer overruns since it's always in the same granule as the end of the
previous chunk.