Skip to content

[CI validation only] ARM MTE memory provider - #1

Open
SebStefenel wants to merge 3 commits into
mainfrom
feat/arm-mte-memory-provider
Open

SebStefenel wants to merge 3 commits into
mainfrom
feat/arm-mte-memory-provider

Conversation

@SebStefenel

Copy link
Copy Markdown
Owner

Scratch PR used only to run the PR workflow (Clippy, x86_64/arm64 builds,
asan/tsan, Common checks) against the branch proposed upstream in
eclipse-score#630, which is gated behind first-time-contributor
workflow approval.

Not for merge. Will be closed once the checks are green.

🤖 Generated with Claude Code

Implement ARM Memory Tagging Extension (MTE) memory provider to protect
allocated memory regions via hardware tagging. Guarded behind the
//config:enable_arm_mte Bazel flag so users can enable it once the
target hardware and OS support MTE.

Closes eclipse-score#119

Signed-off-by: Sebastian Stefenel <stefenel.sebastian@gmail.com>
Fix the borrow checker error in the read/write boundary test, which broke
every Rust build, the Clippy job and the sanitizer jobs.

Replace the `core::arch::aarch64::__arm_mte_*` intrinsics by inline `irg`
and `stg` instructions. The intrinsics are nightly-only (stdarch_aarch64_mte),
so the backend could never have been compiled by the stable toolchain.

Correct the prctl definitions: PR_SET_TAGGED_ADDR_CTRL is 55 (56 queries the
setting), PR_TAGGED_ADDR_ENABLE is bit 0, and the tag inclusion mask has to be
set, otherwise `irg` is only allowed to generate tag 0.

Degrade to plain, unprotected memory instead of failing the allocation when
MTE is requested but unavailable, so x86_64, sanitizer and QNX builds keep
working with the feature enabled. `is_protection_active` and the new
`is_protected` report whether a region is hardware-protected, so the degraded
configuration stays detectable.

Build the MTE backend for aarch64 Linux so that it gets compile coverage, no
default configuration compiles it.

Sort the imports and the BUILD attributes as the formatter expects.

Signed-off-by: Sebastian Stefenel <stefenel.sebastian@gmail.com>
@SebStefenel SebStefenel reopened this Sep 14, 2026
A pointer read straight out of the `irg` `asm!` block carries no provenance
of the mapping it points into, which the strict provenance model does not
allow to be dereferenced. Take only the tagged address from the block and
rebuild the pointer with `with_addr`, which keeps the provenance of the
mapping. The nightly `__arm_mte_create_random_tag` intrinsic preserves it the
same way.

Document that tags cover whole 16-byte granules, so an access up to 15 bytes
past the requested size still matches the tag of the region and is not
detected.

Document that querying `is_protection_active` enables tag checking for the
calling thread, which is a per-thread kernel setting.

Signed-off-by: Sebastian Stefenel <stefenel.sebastian@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant