Last commit made on 2020-11-20
Get this branch:
git clone -b rearnsha/mte-v3.0

Branch merges

Branch information


Recent commits

8a9f2a6... by Richard Earnshaw <email address hidden> on 2020-11-20

aarch64: Add aarch64-specific files for memory tagging support

This final patch provides the architecture-specific implementation of
the memory-tagging support hooks for aarch64.

05ab98e... by Richard Earnshaw <email address hidden> on 2020-11-20

aarch64: Add sysv specific enabling code for memory tagging

Add various defines and stubs for enabling MTE on AArch64 sysv-like
systems such as Linux. The HWCAP feature bit is copied over in the
same way as other feature bits. Similarly we add a new wrapper header
for mman.h to define the PROT_MTE flag that can be used with mmap and
related functions.

We add a new field to struct cpu_features that can be used, for
example, to check whether or not certain ifunc'd routines should be
bound to MTE-safe versions.

Finally, if we detect that MTE should be enabled (ie via the glibc
tunable); we enable MTE during startup as required.

4b1d715... by Richard Earnshaw <email address hidden> on 2020-11-20

linux: Add compatibility definitions to sys/prctl.h for MTE

Older versions of the Linux kernel headers obviously lack support for
memory tagging, but we still want to be able to build in support when
using those (obviously it can't be enabled on such systems).

The linux kernel extensions are made to the platform-independent
header (linux/prctl.h), so this patch takes a similar approach.

cf7f5e3... by Richard Earnshaw <email address hidden> on 2020-11-20

malloc: support MALLOC_CHECK_ in conjunction with _MTAG_ENABLE.

Note, I propose that this patch will be merged into the main malloc
changes before committing, it is kept separate here to simplify

c1687e1... by Richard Earnshaw <email address hidden> on 2020-11-20

malloc: Clean up commentary

This patch will be merged with its predecessor before being committed, it is
kept separate for now to ease reviewing.

673e7b3... by Richard Earnshaw <email address hidden> on 2020-11-20

malloc: Basic support for memory tagging in the malloc() family

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

9484a83... by Richard Earnshaw <email address hidden> on 2020-11-20

elf: Add a tunable to control use of tagged memory

Add a new glibc tunable: mtag.enable, bound to the environment variable
_MTAG_ENABLE. This is a decimal constant in the range 0-255 but used
as a bit-field.

Bit 0 enables use of tagged memory in the malloc family of functions.
Bit 1 enables precise faulting of tag failure on platforms where this
can be controlled.
Other bits are currently unused, but if set will cause memory tag
checking for the current process to be enabled in the kernel.

43693a1... by Richard Earnshaw on 2020-11-20

config: Allow memory tagging to be enabled when configuring glibc

This patch adds the configuration machinery to allow memory tagging to be
enabled from the command line via the configure option --enable-memory-tagging.

The current default is off, though in time we may change that once the API
is more stable.

4e58941... by Samuel thibault on 2020-11-13

hurd: Enable using ifunc

Bugs have been fixed in binutils/gcc/glibc.

3dbbd2f... by Samuel thibault on 2020-11-13

Add {,sysdep-}ld-library-path make variable

On GNU/Hurd we not only need $(common-objpfx) in LD_LIBRARY_PATH when loading
dynamic objects, but also $(common-objpfx)/mach and $(common-objpfx)/hurd. This
adds an ld-library-path variable to be used as LD_LIBRARY_PATH basis in
Makefiles, and a sysdep-ld-library-path variable for sysdeps to add some
more paths, here mach/ and hurd/.