Being a passionate security engineer, I care deeply about memory safety and exploit mitigation. This latest setup is a proof of concept for the Mastodon app stack that I also care deeply about because it further protects the communities I host as part of Disobey Discotheque, gay.amsterdam and disobey.net. Disobey Discotheque already hosts an open source Web Application Firewall (WAF) called Coraza in front of Mastodon to defend against the OWASP top 10.The old Disobey Discotheque Mastodon architectureBefore adding the Radxa Orion O6 [1] system board into Disobey Discotheque's self-hosted compute stack, gay.amsterdam and disobey.net each ran in their own Proxmox VM. gay.amsterdam had a Debian VM, and disobey.net had an Ubuntu VM. Each VM ran everything for its isolated Mastodon instance; the Mastodon apps, the database, search and media storage.The new Disobey Discotheque Mastodon architectureThe Mastodon apps for both instances have moved onto a Radxa Orion O6. Radxa describes the board as built on "Armv9.2 Architecture" [1] and is known to support Arm's Memory Tagging Extension in its BIOS as an opt-in feature [2]. Migrating disobey.net to this board let Disobey Discotheque retire the Ubuntu VM that hosted disobey.net, and we added cyber.cafe as a development and testing Mastodon instance. The user data for all three instances now lives in one Proxmox VM configured carefully with its own software isolation and hardening. New, automatic patching always applies to cyber.cafe first; new Mastodon releases, Ruby patch releases, and Tor updates for the WebTunnel bridges. Each change is applied to cyber.cafe, checked, and only then applied to gay.amsterdam and then disobey.net. The Radxa Orion O6 reaches the Proxmox VM via 10G LAN over an encrypted WireGuard tunnel.AppRuns onPuma (web server)Radxa Orion O6 (MTE)Sidekiq (background jobs)Radxa Orion O6 (MTE)libvips (images)Radxa Orion O6 (MTE)ffmpeg (video)Radxa Orion O6 (MTE)Node.js streaming serverRadxa Orion O6 (MTE)RedisRadxa Orion O6 (MTE)Tor bridgesRadxa Orion O6 (MTE)PostgreSQL (databases)Proxmox x86_64 VM (no MTE)Elasticsearch (search)Proxmox x86_64 VM (no MTE)Media file storageProxmox x86_64 VM (no MTE)Why MTE is an actual "game changer"MTE is literally a game changer for general purpose computing safety, via exploit mitigation. It matters most for software written in C and C++, which can't protect its own memory. Memory safe languages such as Rust, Go, and Swift protect most of their own memory, but they still run on top of C and C++ code, like the Linux kernel, and MTE protects that too.Memory bugsWhen an application runs, it keeps its data in memory. Think of memory as a long row of gym lockers. When an application needs space in memory, it asks the memory allocator for some gym lockers and gets back a note with the locker numbers that the application can use. The allocator gets massive blocks of lockers from the Linux kernel ahead of time, and hands them out in smaller pieces. That note from the allocator is called a pointer. Applications written in C and C++ blindly trust that note completely. Nothing stops an application from opening a gym locker that isn't on its note. This fundamental insecurity leads to two very common bugs:Buffer overflow: the application was given lockers 10 to 19, but it also opens locker 20, which belongs to something else.Use-after-free: the application gave locker 10 back, but kept the old note, and later opens locker 10 again. By then, the locker belongs to something else.Attackers use these two types of bugs to change data they shouldn't be able to touch. From there, attackers can often take over the whole application, read and write data belonging to that application, or even gain broader permissions that the compromised application has. This is not rare or trivial, the Chromium project has said "around 70% of our serious security bugs are memory safety problems." [3]What changes with hardware-backed MTEBefore MTE, most defenses made memory bugs harder to use. Apart from rare exceptions like Oracle's SPARC M7, the physical CPU itself never knew which gym lockers belonged to whom.With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm says "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub glitch for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Before adding the Radxa Orion O6 [1] system board into Disobey Discotheque's self-hosted compute stack, gay.amsterdam and disobey.net each ran in their own Proxmox VM. gay.amsterdam had a Debian VM, and disobey.net had an Ubuntu VM. Each VM ran everything for its isolated Mastodon instance; the Mastodon apps, the database, search and media storage.The new Disobey Discotheque Mastodon architectureThe Mastodon apps for both instances have moved onto a Radxa Orion O6. Radxa describes the board as built on "Armv9.2 Architecture" [1] and is known to support Arm's Memory Tagging Extension in its BIOS as an opt-in feature [2]. Migrating disobey.net to this board let Disobey Discotheque retire the Ubuntu VM that hosted disobey.net, and we added cyber.cafe as a development and testing Mastodon instance. The user data for all three instances now lives in one Proxmox VM configured carefully with its own software isolation and hardening. New, automatic patching always applies to cyber.cafe first; new Mastodon releases, Ruby patch releases, and Tor updates for the WebTunnel bridges. Each change is applied to cyber.cafe, checked, and only then applied to gay.amsterdam and then disobey.net. The Radxa Orion O6 reaches the Proxmox VM via 10G LAN over an encrypted WireGuard tunnel.AppRuns onPuma (web server)Radxa Orion O6 (MTE)Sidekiq (background jobs)Radxa Orion O6 (MTE)libvips (images)Radxa Orion O6 (MTE)ffmpeg (video)Radxa Orion O6 (MTE)Node.js streaming serverRadxa Orion O6 (MTE)RedisRadxa Orion O6 (MTE)Tor bridgesRadxa Orion O6 (MTE)PostgreSQL (databases)Proxmox x86_64 VM (no MTE)Elasticsearch (search)Proxmox x86_64 VM (no MTE)Media file storageProxmox x86_64 VM (no MTE)Why MTE is an actual "game changer"MTE is literally a game changer for general purpose computing safety, via exploit mitigation. It matters most for software written in C and C++, which can't protect its own memory. Memory safe languages such as Rust, Go, and Swift protect most of their own memory, but they still run on top of C and C++ code, like the Linux kernel, and MTE protects that too.Memory bugsWhen an application runs, it keeps its data in memory. Think of memory as a long row of gym lockers. When an application needs space in memory, it asks the memory allocator for some gym lockers and gets back a note with the locker numbers that the application can use. The allocator gets big blocks of lockers from the Linux kernel ahead of time, and hands them out in smaller pieces. That note from the allocator is called a pointer. Applications written in C and C++ blindly trust that note completely. Nothing stops an application from opening a gym locker that isn't on its note. This fundamental insecurity leads to two very common bugs:Buffer overflow: the application was given lockers 10 to 19, but it also opens locker 20, which belongs to something else.Use-after-free: the application gave locker 10 back, but kept the old note, and later opens locker 10 again. By then, the locker belongs to something else.Attackers use these two types of bugs to change data they shouldn't be able to touch. From there, attackers can often take over the whole application, read and write data belonging to that application, or even gain broader permissions that the compromised application has. This is not rare or trivial, the Chromium project has said "around 70% of our serious security bugs are memory safety problems." [3]What changes with hardware-backed MTEBefore MTE, most defenses made memory bugs harder to use. Apart from rare exceptions like Oracle's SPARC M7, the physical CPU itself never knew which gym lockers belonged to whom.With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm notes "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub problem for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
The Mastodon apps for both instances have moved onto a Radxa Orion O6. Radxa describes the board as built on "Armv9.2 Architecture" [1] and is known to support Arm's Memory Tagging Extension in its BIOS as an opt-in feature [2]. Migrating disobey.net to this board let Disobey Discotheque retire the Ubuntu VM that hosted disobey.net, and we added cyber.cafe as a development and testing Mastodon instance. The user data for all three instances now lives in one Proxmox VM configured carefully with its own software isolation and hardening. New, automatic patching always applies to cyber.cafe first; new Mastodon releases, Ruby patch releases, and Tor updates for the WebTunnel bridges. Each change is applied to cyber.cafe, checked, and only then applied to gay.amsterdam and then disobey.net. The Radxa Orion O6 reaches the Proxmox VM via 10G LAN over an encrypted WireGuard tunnel.AppRuns onPuma (web server)Radxa Orion O6 (MTE)Sidekiq (background jobs)Radxa Orion O6 (MTE)libvips (images)Radxa Orion O6 (MTE)ffmpeg (video)Radxa Orion O6 (MTE)Node.js streaming serverRadxa Orion O6 (MTE)RedisRadxa Orion O6 (MTE)Tor bridgesRadxa Orion O6 (MTE)PostgreSQL (databases)Proxmox x86_64 VM (no MTE)Elasticsearch (search)Proxmox x86_64 VM (no MTE)Media file storageProxmox x86_64 VM (no MTE)Why MTE is an actual "game changer"MTE is literally a game changer for general purpose computing safety, via exploit mitigation. It matters most for software written in C and C++, which can't protect its own memory. Memory safe languages such as Rust, Go, and Swift protect most of their own memory, but they still run on top of C and C++ code, like the Linux kernel, and MTE protects that too.Memory bugsWhen an application runs, it keeps its data in memory. Think of memory as a long row of gym lockers. When an application needs space in memory, it asks the memory allocator for some gym lockers and gets back a note with the locker numbers that the application can use. The allocator gets substantial blocks of lockers from the Linux kernel ahead of time, and hands them out in smaller pieces. That note from the allocator is called a pointer. Applications written in C and C++ blindly trust that note completely. Nothing stops an application from opening a gym locker that isn't on its note. This fundamental insecurity leads to two very common bugs:Buffer overflow: the application was given lockers 10 to 19, but it also opens locker 20, which belongs to something else.Use-after-free: the application gave locker 10 back, but kept the old note, and later opens locker 10 again. By then, the locker belongs to something else.Attackers use these two types of bugs to change data they shouldn't be able to touch. From there, attackers can often take over the whole application, read and write data belonging to that application, or even gain broader permissions that the compromised application has. This is not rare or trivial, the Chromium project has said "around 70% of our serious security bugs are memory safety problems." [3]What changes with hardware-backed MTEBefore MTE, most defenses made memory bugs harder to use. Apart from rare exceptions like Oracle's SPARC M7, the physical CPU itself never knew which gym lockers belonged to whom.With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm indicates "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub matter for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): vital pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Industry observers note that MTE is literally a game changer for general purpose computing safety, via exploit mitigation. It matters most for software written in C and C++, which can't protect its own memory. Memory safe languages such as Rust, Go, and Swift protect most of their own memory, but they still run on top of C and C++ code, like the Linux kernel, and MTE protects that too.Memory bugsWhen an application runs, it keeps its data in memory. Think of memory as a long row of gym lockers. When an application needs space in memory, it asks the memory allocator for some gym lockers and gets back a note with the locker numbers that the application can use. The allocator gets major blocks of lockers from the Linux kernel ahead of time, and hands them out in smaller pieces. That note from the allocator is called a pointer. Applications written in C and C++ blindly trust that note completely. Nothing stops an application from opening a gym locker that isn't on its note. This fundamental insecurity leads to two very common bugs:Buffer overflow: the application was given lockers 10 to 19, but it also opens locker 20, which belongs to something else.Use-after-free: the application gave locker 10 back, but kept the old note, and later opens locker 10 again. By then, the locker belongs to something else.Attackers use these two types of bugs to change data they shouldn't be able to touch. From there, attackers can often take over the whole application, read and write data belonging to that application, or even gain broader permissions that the compromised application has. This is not rare or trivial, the Chromium project has noted "around 70% of our serious security bugs are memory safety problems." [3]What changes with hardware-backed MTEBefore MTE, most defenses made memory bugs harder to use. Apart from rare exceptions like Oracle's SPARC M7, the physical CPU itself never knew which gym lockers belonged to whom.With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm says "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
When an application runs, it keeps its data in memory. Think of memory as a long row of gym lockers. When an application needs space in memory, it asks the memory allocator for some gym lockers and gets back a note with the locker numbers that the application can use. The allocator gets substantial blocks of lockers from the Linux kernel ahead of time, and hands them out in smaller pieces. That note from the allocator is called a pointer. Applications written in C and C++ blindly trust that note completely. Nothing stops an application from opening a gym locker that isn't on its note. This fundamental insecurity leads to two very common bugs:Buffer overflow: the application was given lockers 10 to 19, but it also opens locker 20, which belongs to something else.Use-after-free: the application gave locker 10 back, but kept the old note, and later opens locker 10 again. By then, the locker belongs to something else.Attackers use these two types of bugs to change data they shouldn't be able to touch. From there, attackers can often take over the whole application, read and write data belonging to that application, or even gain broader permissions that the compromised application has. This is not rare or trivial, the Chromium project has mentioned "around 70% of our serious security bugs are memory safety problems." [3]What changes with hardware-backed MTEBefore MTE, most defenses made memory bugs harder to use. Apart from rare exceptions like Oracle's SPARC M7, the physical CPU itself never knew which gym lockers belonged to whom.With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm indicates "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub glitch for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Attackers use these two types of bugs to change data they shouldn't be able to touch. From there, attackers can often take over the whole application, read and write data belonging to that application, or even gain broader permissions that the compromised application has. This is not rare or trivial, the Chromium project has said "around 70% of our serious security bugs are memory safety problems." [3]What changes with hardware-backed MTEBefore MTE, most defenses made memory bugs harder to use. Apart from rare exceptions like Oracle's SPARC M7, the physical CPU itself never knew which gym lockers belonged to whom.With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm claims "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple revealed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk people, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that before MTE, most defenses made memory bugs harder to use. Apart from rare exceptions like Oracle's SPARC M7, the physical CPU itself never knew which gym lockers belonged to whom.With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm notes "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): notable pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
With MTE, the CPU checks every access to colored memory. The Linux kernel's own configuration help describes MTE as "run-time, always-on detection of various classes of memory error." [4] If an application reaches for memory that isn't its own, the check fails and the application stops (crashes). A crashed application is safer than an exploited application.How Arm v9.2 MTE worksMTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm says "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): notable pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, MTE first appeared in the Armv8.5 version of the Arm architecture and continues in Armv9 [5]. The Radxa Orion O6 uses Armv9.2 cores (Cortex-A720 and Cortex-A520) [1].Lock and keyArm states "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub matter for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Sources indicate that arm indicates "The MTE working principle is based on a Lock and Key model." [6]The lock: memory is split into small pieces of 16 bytes. Each piece gets a small label called a tag.The key: the pointer, the note with the gym locker numbers, carries a tag too.The check: every time the program reads or writes memory, the processor compares the key with the lock.And yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub matter for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): key pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Recent findings suggest that and yes, this comes with a CPU performance hit, which I'll talk about later when juxtaposing Apple's MTE implementation in thier A19, A20 Pro, M5, M6 and S11 SoCs.The Linux kernel documentation indicates MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a new color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub glitch for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that the Linux kernel documentation says MTE "allows software to access a 4-bit allocation tag for each 16-byte granule." [5] A 4-bit tag can hold 16 different values, from 0 to 15. Think of them as 16 colors. When a program is handed memory, the memory and the pointer get the same color. When the memory is given back, it gets a fresh color. So then:A buffer overflow reaches into memory that usually has a different color. The colors don't match. Crash.A use-after-free uses an old pointer with the old color. The memory usually has a new color now. Crash.Where the colors liveThe pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): key pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
The pointer's color sits inside the pointer itself, in spare bits at the top of every 64-bit Arm address. The memory's color sits in a separate, hidden part of RAM. Normal reads and writes can't see or change these colors. Only special CPU instructions can do that. The memory allocator, the software that hands out memory, uses those instructions to color each piece of memory before giving it to the program.What happens on a mismatchThe Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual states that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub concern for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): notable pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple confirmed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Recent findings suggest that the Linux kernel supports four ways to react when the colors don't match. From the kernel documentation [5]:ModeWhat happensIgnoreNothing, the default.Synchronous (sync)The program gets a crash signal right away, and the bad access never happens.Asynchronous (async)The program gets a crash signal later, after one or more bad accesses.AsymmetricReads are checked like sync, writes like async.Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub matter for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Google's Android documentation describes sync mode as "optimized for correctness of bug detection over performance." [7] Every MTE setting on the Radxa Orion O6 uses sync mode, similair to Apple's always-on MTE in their newest Arm-based SoCs.MTE limitationsThere are only 16 colors. A blind guess matches 1 time in 16.MTE only covers memory that something actually colors. Memory that no one colors is not checked.MTE tags can be leaked. A 2024 paper called TikTag describes "gadgets capable of leaking the MTE tags from arbitrary memory addresses through speculative execution." [8]A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual claims that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub concern for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
A newer Arm tech called CPA [9] addressses some of these security gaps, which I'll go into later. Apple's newest SoCs support CPA. This Radxa Orion O6 hardware and firmware does not.How Linux kernel MTE works on Arm v9.2Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual claims that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): vital pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Linux can use MTE in two separate places when the kernel is built and set up for it. One is normal applications, and the other is the kernel's own memory.Normal applicationsAn application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): key pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple confirmed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Recent findings suggest that an application has to ask the Linux kernel to turn on tag checking for itself, and choose a mode. The kernel documentation lists the modes as PR_MTE_TCF_NONE, PR_MTE_TCF_SYNC and PR_MTE_TCF_ASYNC, set with the prctl() system call [5]. The memory itself also has to be marked with PROT_MTE so it can hold colors.Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual states that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Most applications never do this themselves. Instead, the memory allocator does it for them. The allocator is the part of the system that hands out memory. On Debian, that's glibc's malloc.glibc has a setting called glibc.mem.tagging. The glibc manual says that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Industry observers note that glibc has a setting called glibc.mem.tagging. The glibc manual states that with it, the allocator hands out tagged memory, "each allocation being assigned a random tag." [10] On the Raxda Orion O6, every Mastodon service, Redis, and c-Tor gets this line in its systemd unit:Environment=GLIBC_TUNABLES=glibc.mem.tagging=3The value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Industry observers note that the value 3 turns on tagged memory (bit 0) and precise, synchronous checking (bit 1).One more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub glitch for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple unveiled Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Industry observers note that one more fact about glibc matters a lot here. The glibc 2.44 release notes say "The --enable-memory-tagging configure option has been removed," together with the AArch64 code it enabled [11]. Debian 13 ships glibc 2.41, which still has it. The Orion O6's hardening checks block any glibc upgrade to 2.44 or later, because that upgrade would quietly turn heap tagging off.The kernel's own memoryThe kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple unveiled Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Recent findings suggest that the kernel is the most trusted application on the machine. Linux can color the kernel's memory too, using a feature called KASAN in its hardware tag mode. The kernel documentation says this mode "has low memory and performance overheads and thus can be used in production." [12]It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): notable pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It covers the kernel's main memory allocators (slab, page_alloc and non-executable vmalloc) [12]. The Radxa Orion O6's kernel is built from kernel.org source with these options:CONFIG_ARM64_MTE=y
CONFIG_KASAN=y
CONFIG_KASAN_HW_TAGS=yAnd an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, and an MTE-enabled kernel boots with:kasan=on kasan.mode=sync kasan.fault=panicIf the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation indicates that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub concern for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple revealed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, if the system board does not support MTE in hardware or firmware, the kernel still boots with these settings, just without kernel memory tagging. The kernel documentation says that in this case "all KASAN boot parameters are ignored." [12] KASAN doesn't print a warning, so the way to confirm kernel tagging is on is to look for the KernelAddressSanitizer initialized (hw-tags, mode=sync, ...) line in the kernel log.kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, kasan.mode=sync means bad kernel memory accesses are caught right away. kasan.fault=panic means the whole machine stops if one happens, instead of only printing a report.What the Raxda Orion O6 kernel does not have yetBranch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple confirmed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Sources indicate that branch Target Identification (BTI) for the kernel's own code is off. In current Linux source, the kernel BTI option can't be built with GCC or with Clang 21 or newer, because of bugs in those compilers [4], and the Radxa Orion O6's kernel is built with GCC. BTI is on for programs (user space), and pointer authentication (PAC) is on for both. This doesn't depend on Radxa. The Orion O6's Armv9.2 cores support BTI, and only these compiler bugs hold the kernel option back.Why the Mastodon stack, and what parts of MastodonMastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, mastodon is not one application, it's a group of apps working together:Puma, the web server, written in Ruby.Sidekiq, which runs background jobs like sending posts to other servers, also in Ruby.A streaming server, written in Node.js, that pushes live updates to apps.Redis, a fast memory store used as a cache and job queue.PostgreSQL, the main database.Elasticsearch, for search.Media tools, like libvips and ffmpeg, which process images and video.For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README notes it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub concern for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): vital pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple unveiled Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
For Disobey Discotheque's setup, items 1 to 4 and 7 run on the Raxda Orion O6. PostgreSQL, Elasticsearch and media storage run on a separate Proxmox x86_64 VM, which has no MTE support. Unlike the Radxa Orion O6, the Proxmox VM has a redundant ZFS array on NVMe SSDs.The Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README notes it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub problem for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): notable pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Industry observers note that the Orion O6 also runs Tor WebTunnel bridges for each of the three domains, and a small Caddy web server that routes traffic to each Mastodon instance.What is covered, how, and whyPartRuns onCovered by MTEHowWhyLinux kernelOrion O6YesKASAN hardware tags, sync mode, panic on mismatchKernel memory bugs become crashesPuma and Sidekiq (Ruby)Orion O6Partlyglibc malloc taggingPuma handles every web request from the internet, and Sidekiq processes posts and data fetched from other servers. Ruby's C-level memory comes from malloc; Ruby's own object storage uses its own allocatorNative Ruby gems (compiled C code)Orion O6YesUse malloc inside tagged processes; built from source with BTI and PACCompiled C code is where memory bugs live in a Ruby applibvips (images)Orion O6YesLoaded into the Sidekiq process, uses mallocReads untrusted images from anywhere on the fediverseffmpeg (video)Orion O6YesStarted by Sidekiq; inherits the tagging settingReads untrusted video from anywhere on the fediverseNode.js streamingOrion O6Partlyglibc malloc taggingHolds live connections from Mastodon apps. Node's C++ memory comes from malloc; the JavaScript engine's heap uses its own allocatorRedisOrion O6YesBuilt from source with glibc malloc instead of jemallocStores job queues and cache. Every Redis allocation is taggedTor bridges (C tor)Orion O6Yesglibc malloc tagging through a systemd drop-inAccepts connections from strangers and handles their trafficwebtunnel (Tor transport)Orion O6NoWritten in Go, which has its own allocatorGo is a memory-safe languageWhy do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple unveiled Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk people, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that why do some rows say "partly"? Ruby and Node.js each have two helpers that hand out memory. The first helper is glibc's allocator, and it colors every piece of memory it hands out. The second helper is built into Ruby or Node.js itself, for their own small pieces of data, and it does not color anything. Memory from the first helper gets checked by MTE. Memory from the second helper does not.The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub concern for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): vital pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
The code written in Ruby and JavaScript is memory-safe by design, but the engines that run it, Ruby's interpreter (C) and Node.js's JavaScript engine (C++), are not. Much of the compiled C and C++ code underneath gets its memory from the first helper, the one that colors. The engines' own object storage comes from the second helper, so memory bugs in the engines themselves are only partly covered.Why Redis and Ruby use glibc malloc on the Orion O6Redis's own README claims it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub matter for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): notable pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Sources indicate that redis's own README says it uses "jemalloc being the default on Linux systems." [13] jemalloc does not color memory. So on the Orion O6, Redis is built with glibc's allocator instead:make MALLOC=libc BUILD_TLS=no USE_SYSTEMD=no BUILD_WITH_MODULES=no \
REDIS_CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
REDIS_LDFLAGS="-Wl,-z,relro,-z,now"Ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): vital pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Recent findings suggest that ruby is built the same way, without jemalloc, and without its just-in-time compilers:./configure --prefix=/opt/ruby/4.0.10 --enable-shared --with-ext=openssl,psych,+ --disable-install-doc \
--disable-yjit --disable-zjit --without-jemalloc \
CFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
CXXFLAGS="-O2 -mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
LDFLAGS="-Wl,-z,relro,-z,now"An MTE-hardened service unitThis is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it states: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple revealed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
This is the web server unit for gay.amsterdam. The tagging line sits next to the systemd sandbox settings that lock the service down:[Service]
User=gayams
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3
Environment=MALLOC_ARENA_MAX=8
Environment=VIPS_BLOCK_UNTRUSTED=TRUE
NoNewPrivileges=yes
CapabilityBoundingSet=
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
SystemCallFilter=@system-service
ExecStart=/opt/gayams/ruby/bin/bundle exec puma -C config/puma.rbThe Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub concern for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): key pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it notes: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that the Tor bridges get the same setting from one small file:# /etc/systemd/system/tor@.service.d/50-mte.conf
[Service]
Environment=GLIBC_TUNABLES=glibc.mem.tagging=3Compiled code: BTI and PACEvery Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): key pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it states: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Every Ruby gem with compiled code is built from source on the Orion O6, through a compiler wrapper that adds these flags to every compile and link:-mbranch-protection=standard -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=3
-Wl,-z,relro,-z,now-mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub problem for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it indicates: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, -mbranch-protection=standard turns on Arm's BTI and PAC. The build stops if any compiled file is missing them. From disobey.net's build:PASS all 63 linked gem binaries carry BTI, PAC, BIND_NOW and RELROAfter disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub problem for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it notes: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple revealed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
After disobey.net started, a scan of every piece of compiled code loaded by its running services reported:229 executable objects loaded; unhardened local code: noneChecking that tagging is really onLinux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): key pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple confirmed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Linux marks memory regions that hold colors with mt in a file called smaps [5]. This command counts them for one service:p=$(systemctl show -p MainPID --value disobey-web.service)
grep -cE '^VmFlags:.* mt( |$)' /proc/$p/smapsThese are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub glitch for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple unveiled Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk people, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
These are the counts from the Radxa Orion O6 on the day disobey.net moved over:redis-disobey 4
disobey-web 175
disobey-streaming 11
disobey-sidekiq 186
disobey-sidekiq-delivery 200
disobey-sidekiq-intake 217
tor@cybercafe 17
tor@gayams 22
tor@disobey 16Any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): vital pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Recent findings suggest that any number above zero means tagging is live in that process. Redis rewrites the area where Linux stores a program's environment settings when it sets its process title, so counting mt regions is how tagging gets confirmed for Redis.The cost on this boardOur Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub matter for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple confirmed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, our Radxa Orion O6 has 64 GB of RAM. With MTE turned on in the firmware, Linux sees about 28 GiB. A GitHub issue for Radxa's firmware reports that "enabling Memory Tagging Extension in BIOS reduces Linux's total usable RAM to approximately 28GiB." [2] On the Radxa Orion O6, Linux reports MemTotal: 29544488 kB with MTE enabled.Where MTE stops: CFI, HardenedBSD, shadow stacks and CHERIMTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): notable pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it claims: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that MTE protects memory. It is one tool among several, and other projects address the same problem from different directions.Two different jobsA memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): key pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't right now be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple confirmed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
A memory attack usually happens in steps:The attacker finds a memory bug.They use it to change data in memory.An attacker changes where the program goes next to run the attacker's code, which is called hijacking control flow.MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): crucial pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Glitch #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, MTE works at step 2. Control Flow Integrity (CFI) works at step 3. It checks that every jump the program makes goes somewhere that makes sense.Hardware CFI on Arm: BTI and PACBTI (Branch Target Identification): indirect jumps and calls may only land on spots in the code marked as valid landing spots. Any marked spot is accepted.PAC (Pointer Authentication): important pointers, like the address a function returns to, get a cryptographic signature made with a secret key. Before the pointer is used, the signature is checked. The Linux kernel's configuration help lists defending against return-oriented programming (ROP) as its purpose [4].Software CFISoftware CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Concern #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that software CFI is added by the compiler. The Linux kernel's own CFI option (kCFI) adds a check before every indirect function call "to ensure the target is a valid function with the correct static type." [14] That's more precise than BTI's "any marked spot," because the check knows what kind of function should be called.Clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't at the moment be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns vital pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that clang's CFI documentation explains the catch. Most of its CFI checks need link-time optimization, and programs that use shared libraries (.so files) are harder. Of its cross-library mode, it says: "This cross-DSO support has unstable ABI at this time." [15]HardenedBSDHardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report says about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
HardenedBSD is a security-focused fork of FreeBSD that has worked on this for years. It describes the two versions of Clang's CFI like this: non-Cross-DSO CFI covers the application only, while "Cross-DSO CFI applies CFI to both applications and shared objects." [16]HardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report indicates about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns vital pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple unveiled Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Sources indicate that hardenedBSD enabled CFI for its base system on amd64 in 2017 [17]. Its Cross-DSO CFI work has run into problems with shared libraries, package builds, and the C library itself. A 2022 HardenedBSD status report claims about libc: "libc is an incredibly attractive target given its large surface area." [18]Using hardware and software CFI togetherSome systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't presently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple confirmed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk people, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Glitch #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, some systems combine both today. In the Linux kernel on arm64, kCFI can be built alongside BTI, PAC, and the Shadow Call Stack, which Clang says "protects programs against return address overwrites (e.g. stack buffer overflows.)" [19] kCFI needs a compiler that supports -fsanitize=kcfi, which in practice means Clang, and kernel BTI can't currently be built with GCC or with Clang 21 or newer [4]. PAC and the Shadow Call Stack also work with GCC. The Radxa Orion O6's kernel is built with GCC, so it has MTE, KASAN, PAC and user-space BTI, but not kCFI or kernel BTI. The Shadow Call Stack isn't turned on in the Orion O6's kernel.Shadow stacks: Intel CET and Arm GCSIntel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns important pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple revealed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk people, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Glitch #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that intel's Control-flow Enforcement Technology (CET) includes a shadow stack. The Linux kernel describes it as "a secondary stack allocated from memory which cannot be directly modified by applications." [20] On every function call, the return address goes to both stacks. On return, the processor compares them.Arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel says GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns notable pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple revealed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Matter #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, arm's matching feature is called the Guarded Control Stack (GCS), which arrived in Armv9.4. The Linux kernel states GCS is meant to provide "greater protection against return oriented programming (ROP) attacks." [21] The Radxa Orion O6's Armv9.2 cores don't have GCS.ToolJobMTEChecks that memory accesses match their tagsBTIChecks that jumps land on marked spotsPACSigns crucial pointers like return addressesGCS (Arm) and CET shadow stack (Intel)Keep a protected copy of return addresseskCFI and Clang CFICheck the type of function at each indirect callCHERI and MorelloCHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project says CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Problem #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, CHERI is a research project from the University of Cambridge and SRI International that replaces normal pointers with capabilities. A capability carries the exact range of memory it may touch and what it may do with it, and the hardware enforces that on every access. The project claims CHERI aims to "enable fine-grained memory protection and highly scalable software compartmentalization." [22]Arm built a CHERI test chip and board called Morello. Arm says: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple declared Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Matter #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Arm built a CHERI test chip and board called Morello. Arm claims: "Morello was a research program." [23] It's a prototype for research but not a product yet.The difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple revealed Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk owners, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Sources indicate that the difference from MTE is that MTE has 16 colors and catches most bad accesses with high probability. CHERI checks exact bounds on every pointer.Apple's "EMTE" and Google's MTEApple's MTE implementationIn September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk users, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Matter #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Recent findings suggest that in September 2025, Apple announced Memory Integrity Enforcement (MIE) for the iPhone 17 and iPhone Air, built on the A19 and A19 Pro chips [24]. It's also in the M5, M6 and A20 Pro chips, and even the S11 Apple Watch SoC [25]. Apple says MIE delivers always-on memory safety "without compromising our best-in-class device performance." [24] which is a huge leap forward in platform security and broad usability.From Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk people, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, from Apple's announcement [24]:MIE uses Enhanced MTE (EMTE), a newer version of MTE that Apple worked on with Arm.EMTE runs in synchronous mode. Apple says it rejected asynchronous checking because it leaves a window open for attackers.It runs always on for key attack surfaces, including the kernel.It's paired with Apple's secure typed memory allocators, which keep different kinds of data apart.Apple added Tag Confidentiality Enforcement, which protects tags from side-channel and speculative-execution attacks like the ones TikTag describes.Apple dedicated CPU area, CPU speed and memory to tag storage in the A19 chips to support it.App developers can opt their apps in through Xcode's Enhanced Security feature.Google's MTE implementationArm's Pixel 8 guide says "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Matter #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Arm's Pixel 8 guide states "Google Pixel 8 is the first smartphone which supports MTE out-of-the-box." [26] On Pixel phones, MTE is off by default. It can be turned on in Developer Options, and Android 16's Advanced Protection mode turns it on as part of a set of stronger security settings, according to the EFF [27] [28].Apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk customers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS says it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Glitch #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, apple's announcement notes that Google offered MTE to people who opt in to its program for at-risk consumers, and argues that MTE on Android lacks the deep operating system integration of MIE [24].GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS states it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Matter #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
GrapheneOS, a hardened version of Android for Pixel phones, uses MTE in its hardened_malloc allocator for "probabilistic detection of all use-after-free and inter-object overflows," and in its kernel allocators [29]. GrapheneOS notes it was the first platform to use MTE in production, turned on by default for its base OS, a world's first [29].Where the Radxa Orion O6 fitsThe Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
The Radxa Orion O6 works more like Google's approach than Apple's. MTE is available in the hardware, but it's off unless turned on; once in the firmware, and then per program, as shown in the units above. There's a memory cost on the Radxa board, a plain allocator, and no special protection against tag leaks.Apple (A19, A20 Pro, S11, M5, M6)Google Pixel 8 and newerRadxa Orion O6 (Armv9.2)MTE versionEMTEMTEMTEOn by defaultYes, for the kernel and key system surfacesNo (Developer Options or Advanced Protection)No (firmware switch, then per program)Checking modeSyncSync, async or asymm, depending on setupSync, as configured on our serverKernel coveredYesWhen enabledYes (KASAN hardware tags)AllocatorSecure typed allocatorsScudoglibc mallocTag-leak protectionTag Confidentiality EnforcementNot describedNonePerformanceApple says performance is not compromisedMode-dependentNot measured on our server; 64 GB board limited to about 28 GiB with MTE onApple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple says it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Concern #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, apple is way ahead; MTE is always on for the kernel and key system surfaces, synchronous, built into the operating system, and Apple indicates it comes without a performance hit. Google's Pixel devices that have MTE support, and boards like the Radxa Orion O6, have the same core hardware feature, turned on by choice. On every one of these platforms, MTE is still a critical tool for memory safety and exploit mitigation.Checked Pointer Arithmetic (CPA)Going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Matter #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
Industry observers note that going back to the analogy about the note with the gym locker numbers, and the pointer. With MTE, the color is written in the top corner of that note, in the top 8 bits of the pointer.Applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual claims "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Glitch #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
According to recent reports, applications do math on these notes all the time. "Start at locker 10 and go 5 lockers further" is pointer arithmetic. But if an attacker can make that math overflow, adding a huge number for example, the result can spill into the top corner of the note and change the color. A changed color can turn a mismatch into a match, which is a way to get around MTE.Checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual states "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Glitch #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
It has been revealed that checked Pointer Arithmetic (CPA) closes that gap. Arm's architecture manual says "FEAT_CPA introduces support for Checked Pointer Arithmetic instructions." [9] With CPA, the CPU checks pointer math and catches two problems:Math that would change the top 8 bits of a pointer, where MTE keeps the color.Multiplication overflows that calculate an invalid array index, meaning a locker number far outside the range the application was given.CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
CPA comes in two parts, and Arm lists both in its Armv9.5 architecture extension [9]. FEAT_CPA adds the checked instructions. FEAT_CPA2 adds the switch that turns the checking on; Arm's feature descriptions say "FEAT_CPA2 introduces support for enabling Checked Pointer Arithmetic." [30]Apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Issue #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
In a recent development, apple's iOS & iPadOS 27 release notes list A20 Pro, M6 and S11 as the chips that support it, "including CPA2 for stronger MIE protection." [25] Apps only get it when their developers turn it on. Apple's Xcode documentation requires four settings on an app, and without all four there is no protection [31]. The Radxa Orion O6 uses Armv9.2 cores [1], and Arm makes CPA available only from Armv9.4 [9], so this hardware and firmware do not support it.SourcesRadxa, "Radxa Orion O6"GitHub, radxa-pkg/edk2-cix, "Matter #39: MTE reduces usable memory"The Chromium Projects, "Memory safety"Linux kernel source, "arch/arm64/Kconfig"Linux kernel documentation, "Memory Tagging Extension (MTE) in AArch64 Linux"Arm Learning Paths, "Understanding MTE"Android Open Source Project, "Arm Memory Tagging Extension"arXiv, "TikTag: Breaking ARM's Memory Tagging Extension with Speculative Execution"Arm, Arm Architecture Reference Manual, "A2.3.6 The Armv9.5 architecture extension"The GNU C Library manual 2.43, "Memory Related Tunables"The GNU C Library, "NEWS"Linux kernel documentation, "Kernel Address Sanitizer (KASAN)"Redis, "README"Linux kernel source, "arch/Kconfig"Clang documentation, "Control Flow Integrity"HardenedBSD, "Preliminary Call-For-Testing: Cross-DSO CFI"HardenedBSD, "Introducing CFI"HardenedBSD, "September 2022 Status Report"Clang documentation, "ShadowCallStack"Linux kernel documentation, "Control-flow Enforcement Technology (CET) Shadow Stack"Linux kernel documentation, "Guarded Control Stack support for AArch64 Linux"University of Cambridge, "CHERI"Arm, "Morello Program"Apple Security Research, "Memory Integrity Enforcement"Apple Developer, "iOS & iPadOS 27 Release Notes"Arm Learning Paths, "Enabling MTE on Pixel 8"Electronic Frontier Foundation, "Google's Advanced Protection Arrives on Android: Should You Use It?"android-ndk mailing list, "Advanced Protection Mode in Android 16 turns on Memory Tagging Extension?"GrapheneOS, "Features"Arm, Feature descriptions, "The Armv9.5 architecture extension"Blake Crosley, "arm64e.x1: Apple's Checked Pointer Arithmetic Slice"yawnbox.
→ Read original article