Block ARM64 exec with live CLONE_VM siblings#407
Merged
Conversation
Reject ARM64 exec while a live CLONE_VM sibling still holds the old inherited CR3. This prevents parent exec from draining/freeing an address space still reachable through a sibling Process until proper thread-group exec teardown exists. Co-authored-by: Ryan Breen <ryan@ryanbreen.com> Co-authored-by: Claude Code <noreply@anthropic.com>
Add a userspace test that keeps a CLONE_VM child alive while the parent attempts exec, so the ARM64 inherited-CR3 UAF path is exercised at runtime. Co-authored-by: Ryan Breen <ryan@ryanbreen.com> Co-authored-by: Claude Code <noreply@anthropic.com>
Owner
Author
|
TURN 342 runtime proof added in Unfixed comparison (
Fixed branch (
|
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.
Summary
-EAGAINfor that specific stopgap rejection from the ARM64 exec syscall path.breenix-45iwith a conservative stopgap until proper POSIX thread-group exec teardown exists.Root cause
sys_clonecreates CLONE_VM siblings as separateProcessobjects and stores the parent's page-table root ininherited_cr3. ARM64 exec later replaces and drains the parent's old page table, but previously did not clear or reject siblings still holding that old CR3. If such a sibling survived parent exec, context switching it could reinstall a freed address-space root.Reproduction note
A fresh pre-fix Parallels boot reached the direct CLONE_VM path through
/bin/hello_worldand completed the thread test, but the currenthello_worldprogram waits for the child and does not parent-exec afterward. I did not observe a hard UAF crash from the existing binary alone; the crash condition is code-proven by the staleinherited_cr3lifetime and would require parent exec with a live CLONE_VM sibling.Verification
cargo build --release --target aarch64-breenix.json -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem -p kernel --bin kernel-aarch64/bin/hello_worldrerun over SSH: CLONE_VM thread test completed andAll std tests passed!DATA_ABORT=0,UNHANDLED_EC=0,FATAL=0,PANIC=0,SCHED_RESCUE=0,SOFT_LOCKUP=0,DEFER_SNAP/TRACE BUFFER DUMP=0