[PATCH 0/2] memtag: Fix and clean-up code

Yury Khrustalev yury.khrustalev@arm.com
Fri Mar 20 11:36:55 GMT 2026


As explained in [1], we need to change two things:

 1) the '--enable-memory-tagging' configure flag.
 2) the 'glibc.mem.tagging' tunable making in target-specific.

And we also need to fix:

 1) When prctl(PR_SET_TAGGED_ADDR_CTRL, ...) is made.
 2) An MTE-related segfault in __libc_free().
 3) Lack of MTE-related tests for malloc.

This patch series does all that. See corresponding commit messages for
more details.

Regression checked on aarch64, x86-64, and several other targets (using
build-many-glibcs). OK for trunk?

---

[1]: https://inbox.sourceware.org/libc-alpha/abpzpwY6C2ycSnv7@arm.com/

---

Yury Khrustalev (2):
  malloc: change --enable-memory-tagging configure flag
  malloc: change tunable glibc.mem.tagging to glibc.mem.aarch64_mte

 INSTALL                                       |  30 ++---
 config.h.in                                   |   5 +-
 config.make.in                                |   2 -
 configure                                     |  31 +++---
 configure.ac                                  |  28 +++--
 elf/dl-tunables.list                          |   5 -
 malloc/arena.c                                |   9 +-
 malloc/malloc.c                               |   6 +-
 manual/install.texi                           |  34 ++++--
 manual/tunables.texi                          |  36 ++----
 sysdeps/aarch64/Makefile                      |   1 +
 sysdeps/aarch64/__mtag_tag_region.S           |   4 +-
 sysdeps/aarch64/__mtag_tag_zero_region.S      |   4 +-
 sysdeps/aarch64/configure                     |  30 +++++
 sysdeps/aarch64/configure.ac                  |  26 +++++
 sysdeps/aarch64/cpu-features.h                |  11 +-
 sysdeps/aarch64/dl-diagnostics-cpu.c          |   3 +-
 sysdeps/aarch64/dl-mte.c                      |  65 +++++++++++
 sysdeps/aarch64/dl-prop.h                     |  11 ++
 sysdeps/aarch64/dl-start.S                    |   4 +
 sysdeps/aarch64/dl-tunables.list              |   5 +
 sysdeps/aarch64/libc-mtag.h                   |  24 +++-
 sysdeps/generic/libc-mtag.h                   |  15 +++
 sysdeps/unix/sysv/linux/aarch64/Makefile      |  17 +++
 .../unix/sysv/linux/aarch64/cpu-features.c    |  53 +++++----
 .../unix/sysv/linux/aarch64/dl-procruntime.c  |  16 +++
 sysdeps/unix/sysv/linux/aarch64/libc-start.h  |   9 ++
 .../unix/sysv/linux/aarch64/tst-mte-helper.h  | 104 ++++++++++++++++++
 .../unix/sysv/linux/aarch64/tst-mte-malloc.c  |  68 ++++++++++++
 .../unix/sysv/linux/aarch64/tst-mte-realloc.c |  64 +++++++++++
 30 files changed, 590 insertions(+), 130 deletions(-)
 create mode 100644 sysdeps/aarch64/dl-mte.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/tst-mte-helper.h
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/tst-mte-malloc.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/tst-mte-realloc.c

-- 
2.47.3



More information about the Libc-alpha mailing list