[PATCH v2 3/6] malloc: Basic support for memory tagging in the malloc() family

Richard Earnshaw rearnsha@arm.com
Wed Jun 24 15:53:46 GMT 2020

This patch adds the basic support for memory tagging.

Various flavours are supported, particularly being able to turn on
tagged memory at run-time: this allows the same code to be used on
systems where memory tagging support is not present without neededing
a separate build of glibc.  Also, depending on whether the kernel
supports it, the code will use mmap for the default arena if morecore
does not, or cannot support tagged memory (on AArch64 it is not

All the hooks use function pointers to allow this to work without
needing ifuncs.

malloc: allow memory tagging to be controlled from a tunable
 malloc/arena.c              |  43 ++++++++-
 malloc/hooks.c              |   6 ++
 malloc/malloc.c             | 186 ++++++++++++++++++++++++++++--------
 malloc/malloc.h             |   7 ++
 sysdeps/generic/libc-mtag.h |  52 ++++++++++
 5 files changed, 252 insertions(+), 42 deletions(-)
 create mode 100644 sysdeps/generic/libc-mtag.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0003-malloc-Basic-support-for-memory-tagging-in-the-ma.patch
Type: text/x-patch
Size: 22410 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20200624/67344dee/attachment-0001.bin>

More information about the Libc-alpha mailing list