Enabling MTE for the LLDB Test Suite
Enhanced Memory Tagging Extension (EMTE) is a hardware-based security technology to protect against memory corruption vulnerabilities. Memory allocations are tagged with a secret key. When memory is accessed, the hardware validates the tag, and if it doesn’t match, stops the process. EMTE is the foundation of Apple’s Memory Integrity Enforcement (MIE). It’s available on A19 and M5 processors or later. Using MTE for Finding Bugs (E)MTE is not just valuable in a security context. It was originally designed as a tool for hardware to help find memory corruption bugs. Compared to other tools for detecting memory safety issues, such as AddressSanitizer, MTE has several benefits. Most notably, its CPU and memory overhead are significantly smaller than software-assisted tools, usually somewhere in the single-digit percentage range. For comparison, ASan usually has a 2x slowdown and a 3x memory overhead. MTE also requires no recompilation and can be dynamically turned on and off at runtime. ...