[v5,0/6,committed] Memory tagging support

Message ID 20201221153345.3742-1-rearnsha@arm.com
Headers
Series Memory tagging support |

Message

Richard Earnshaw Dec. 21, 2020, 3:33 p.m. UTC
  Final version, as committed to master.

The following minor tweaks were made:
 - Move some preprocessor definitions from malloc/malloc.h to include/malloc.h
 - Fix a comment in arena.c
 - Fix non-GNU style in sysdeps/aarch64/libc-mtag.h
 - updated one commit message to indicate version of linux that supports MTE.
 - sprinkle some Reviewed-by where appropriate.

With thanks to Szabolcs and Siddhesh for prompt reviews.

R.

Richard Earnshaw (6):
  config: Allow memory tagging to be enabled when configuring glibc
  elf: Add a tunable to control use of tagged memory
  malloc: Basic support for memory tagging in the malloc() family
  linux: Add compatibility definitions to sys/prctl.h for MTE
  aarch64: Add sysv specific enabling code for memory tagging
  aarch64: Add aarch64-specific files for memory tagging support

 INSTALL                                       |  14 +
 config.h.in                                   |   3 +
 config.make.in                                |   2 +
 configure                                     |  22 ++
 configure.ac                                  |  15 +
 elf/dl-tunables.list                          |   9 +
 include/malloc.h                              |   8 +
 malloc/arena.c                                |  59 ++-
 malloc/hooks.c                                |  79 ++--
 malloc/malloc.c                               | 336 ++++++++++++++----
 manual/install.texi                           |  13 +
 manual/tunables.texi                          |  35 ++
 sysdeps/aarch64/Makefile                      |   5 +
 sysdeps/aarch64/__mtag_address_get_tag.S      |  32 ++
 sysdeps/aarch64/__mtag_memset_tag.S           |  53 +++
 sysdeps/aarch64/__mtag_new_tag.S              |  37 ++
 sysdeps/aarch64/__mtag_tag_region.S           |  51 +++
 sysdeps/aarch64/libc-mtag.h                   |  57 +++
 sysdeps/generic/libc-mtag.h                   |  52 +++
 sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h  |   1 +
 sysdeps/unix/sysv/linux/aarch64/bits/mman.h   |   1 +
 .../unix/sysv/linux/aarch64/cpu-features.c    |  30 ++
 .../unix/sysv/linux/aarch64/cpu-features.h    |   2 +
 sysdeps/unix/sysv/linux/sys/prctl.h           |  18 +
 24 files changed, 837 insertions(+), 97 deletions(-)
 create mode 100644 sysdeps/aarch64/__mtag_address_get_tag.S
 create mode 100644 sysdeps/aarch64/__mtag_memset_tag.S
 create mode 100644 sysdeps/aarch64/__mtag_new_tag.S
 create mode 100644 sysdeps/aarch64/__mtag_tag_region.S
 create mode 100644 sysdeps/aarch64/libc-mtag.h
 create mode 100644 sysdeps/generic/libc-mtag.h
  

Comments

Andreas Schwab Dec. 22, 2020, 12:49 p.m. UTC | #1
This breaks everything.  I'm getting "realloc(): invalid next size" all
over the place.

Andreas.
  
Siddhesh Poyarekar Dec. 22, 2020, 12:58 p.m. UTC | #2
On 12/22/20 6:19 PM, Andreas Schwab wrote:
> This breaks everything.  I'm getting "realloc(): invalid next size" all
> over the place.

On arm64 or on x86_64?  Also, which tests is it breaking and with what 
configuration?  I haven't seen any failures with --prefix=/usr or with 
--enable-memory-tagging on x86_64.  I trust Szabolcs/Richard tested arm64.

Siddhesh
  
Andreas Schwab Dec. 22, 2020, 1:21 p.m. UTC | #3
On Dez 22 2020, Siddhesh Poyarekar wrote:

> On arm64 or on x86_64?

Everywhere.

> Also, which tests is it breaking and with what configuration?

Everything.

> I haven't seen any failures with --prefix=/usr or with
> --enable-memory-tagging on x86_64.  I trust Szabolcs/Richard tested
> arm64.

Try setting MALLOC_CHECK_.

Andreas.