Skip to content

Ignore the tags of aarch64 pointers where the kernel does - #4151

Open
Keno wants to merge 1 commit into
rr-debugger:masterfrom
ChronitonAI:aarch64-tagged-addresses
Open

Keno wants to merge 1 commit into
rr-debugger:masterfrom
ChronitonAI:aarch64-tagged-addresses

Conversation

@Keno

@Keno Keno commented Nov 5, 2026

Copy link
Copy Markdown
Member

[Encountered, debugged, test, patch by AI]

On aarch64 the kernel ignores the tag in the top byte of the address of mprotect(), pkey_mprotect(), munmap() and madvise() and of mremap()'s old address, and of the pointers that syscalls access once the thread enables the tagged address ABI. rr updated its model of the tracee's memory with the tagged address, which is outside every mapping, so e.g. a page made writable through a tagged pointer stayed read-only in the model. And it read and wrote tracee memory at the tagged address, which for tags of 0x80 and above is a negative /proc//mem offset that pread() and pwrite() reject, so rr asserted. Untag these addresses.

Test: arm/tagged_addr_syscalls.

On aarch64 the kernel ignores the tag in the top byte of the address
of mprotect(), pkey_mprotect(), munmap() and madvise() and of mremap()'s
old address, and of the pointers that syscalls access once the thread
enables the tagged address ABI. rr updated its model of the tracee's
memory with the tagged address, which is outside every mapping, so e.g.
a page made writable through a tagged pointer stayed read-only in the
model. And it read and wrote tracee memory at the tagged address, which
for tags of 0x80 and above is a negative /proc/<pid>/mem offset that
pread() and pwrite() reject, so rr asserted. Untag these addresses.

Test: arm/tagged_addr_syscalls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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