Who is this for?

This is an advanced topic for software developers who want to learn how to use the Memory Tagging Extension (MTE) to protect dynamic memory allocations.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Learn how to apply MTE to an existing memory allocator
  • Understand how MTE can prevent common memory use errors

Prerequisites

Before starting, you will need the following:

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll add Arm MTE checks to a Linux dynamic memory allocator. You’ll enable tagged addresses and synchronous checking, update the allocator and tag helpers, and run misuse examples that trigger mismatches. You’ll trace tag setup and checks across heap.c, heap.h, mte_utils.c, mte_utils.h, and main.c, then inspect the resulting exceptions.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Which files should I modify to explore allocator and tagging behavior?
Edit heap.c and heap.h for allocator changes and mte_utils.c and mte_utils.h for tag helper logic. Use main.c to exercise the allocator and drive specific scenarios.
How do I run the example misuse cases that demonstrate tag faults?
Add calls in main.c to the example functions and rebuild the project. Each function triggers a scenario so you can observe how the MTE-enabled allocator responds.
What should I check if no tag faults occur when I expect them?
Verify that process and heap initialization that enables tagged addresses runs before any allocations. Also confirm that the example functions are called from main.c.
What result should I expect when there is a tag mismatch?
On access, MTE compares the pointer’s logical tag with the memory’s allocation tag and raises an exception if they differ. The demo scenarios are designed to make this behavior visible.
Which tag checking mode does the demo configure?
The initialization sets synchronous tag checking. Apply this configuration when enabling tagged addresses for the process.
Next