Overview

Opensource support for Armv8.5-A Memory Tagging Extension [MTE]

Linux Kernel

Linux kernel support for MTE is currently in development on Linux Kernel Mailing List

The kernel ABI has been modified to permit the passing of tags in the top byte of the pointer ("Top Byte Ignore" or TBI). Linux now require userspace to select between current ABI (which requires the top byte to be 0 for userspace pointers when passing them to the kernel) and passing tagged pointers. Support for the relaxed ABI is needed for both the software HWASAN feature and Arm MTE, and has been merged in kernel v5.4.  Documentation is here: https://www.kernel.org/doc/html/latest/arm64/tagged-address-abi.html

The arm64 specific kernel support for MTE userspace is in active development here [PATCH v4 15 May 2020]:

https://lore.kernel.org/linux-arm-kernel/20200515171612.1020-1-catalin.marinas@arm.com/

Android Userspace

Android makes use of TBI from Android 11 (R), described in https://source.android.com/devices/tech/debug/tagged-pointers

Android support for heap tagging is provided by scudo (new allocator being used by Android AOSP in place of jemalloc): https://reviews.llvm.org/D70762

Tools support

Stack Tagging

Stack tagging has been implemented in clang (LLVM C-compiler) and has become available in LLVM 9.0

There are also plans for implementation in GCC.

ARM ACLE for memory tagging

https://developer.arm.com/docs/101028/latest/memory-tagging-intrinsics

These can be used in place of inline assembly for access to memory tagging instructions.  They are supported by gcc and LLVM/clang.

 

Resources