[PATCH 3/3] malloc: Remove currently broken memory tagging
Yury Khrustalev
yury.khrustalev@arm.com
Fri May 8 15:00:53 GMT 2026
On Fri, May 08, 2026 at 04:52:25PM +0200, Florian Weimer wrote:
> * Yury Khrustalev:
>
> > Remove AArch64-specific code, that is currently broken, from the
> > core malloc implementation.
> >
> > Code clean-up, no functional change unrelated to memory tagging.
>
> For future reference, it might be helpful to put into the commit message
> why this is broken (highlights are enough).
Makes sense, perhaps I should create a bugzilla for this.
> ...
>
> Was it actually broken? Maybe I botched my testing, but I could boot on
> AArch64 system where glibc was patched to enable memory tagging
> unconditionally.
Have you run it on a system that has HWCAP2_MTE? One thing that doesn't
work is that calling free(ptr) results in a SIGSEGV if ptr is tagged and
memory it points to is also tagged. But of course for this to happen the
system should have HWCAP2_MTE, and Glibc (or your test) should do prctl
syscall with PR_SET_TAGGED_ADDR_CTRL and then malloc should use mmap with
PROT_MTE.
If you manage to enable memory tagging in malloc correctly, a lot of
malloc tests from the Glibc testsuite fail (due to similar segfaults
resulting from tag mismatch).
Thanks,
Yury
More information about the Libc-alpha
mailing list