[CI validation only] ARM MTE memory provider - #1
Open
SebStefenel wants to merge 3 commits into
Open
SebStefenel wants to merge 3 commits into
SebStefenel wants to merge 3 commits into
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scratch PR used only to run the
PRworkflow (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