[FEATURE] Add Kernel return and writer proofs to cleanup frame analysis #19
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/exsh#19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and motivation
Exsh's cleanup frame checker treats syscalls as opaque because it has no checked
description of the selected Kernel's return paths and memory writes. This
prevents it from preserving otherwise known register and stack facts across a
query. The broader frame-proof work remains tracked in Exsh #4.
The compiler invocation owner addresses producer custody and leaves
Kernel effects open; this proposal supplies that separate proof domain.
Proposed behavior and scope
Extend Exsh's static proof model with an explicitly selected Kernel programme
context and a return/writer contract. The contract must apply to any task
satisfying its checked entry conditions, carrying the original task generation,
saved frame and occupied user stack through the complete call and return.
The first implementation milestone covers one native
query_local_capaction,one actual Exsh profile and one matching Kernel configuration. Include its
unconditional retirement work, final accounting and machine-state restoration.
Other syscalls and unmatched configurations retain their existing refusal.
Authority, security and reliability
The Kernel retains ownership of task identity and mappings. Host file capture
and process observation confer no guest authority. Derive the action and its
effects from the selected programme; names, ABI assumptions, copied identities
and caller-written receipts cannot establish preservation.
Keep loader and memory-safety premises explicit. Cover aliases, asynchronous
writers, generation reuse, mapping retirement and error paths. Unknown effects
remain refusals. Preserve the checker’s resource accounting, cleanup and first
error handling. Apply security, reliability, then performance.
Acceptance criteria
complete selected Kernel programme, native dependencies, configuration and
relocations, preserving original ownership and declared trust boundaries.
arguments, and prove an invariant linking the original task generation to
its saved frame and live user stack across every reached writer and
retirement path.
terminal and switched-task paths; retain unresolved callees and executed
relocation assumptions as explicit dependencies.
Keep syscall effects opaque whenever the action, programme or lifetime
premises do not match; do not introduce an unconditional preservation mask.
stack aliases, premature mapping release, unknown writers, mixed artifacts,
altered relocations, malformed arguments and incomplete cleanup.
Demonstrate the first milestone with real selected native artifacts while
preserving independent source, stack and mapping requirements.
Measure checker time and memory against the existing profile before making
performance claims or changing resource policy.
Alternatives and tradeoffs
Keeping syscalls opaque remains safe while this work is incomplete. ABI-based
preservation or a wrapper allowlist would leave the Kernel's writers unproved.
Per-execution guest snapshots would change the static checker's domain and
would not establish a universal return contract. Starting with one query and
configuration gives a complete first milestone before extending coverage.
Tracking and rollout
This is a focused design dependency of Exsh #4, with Kernel lifetime
and authority review under Kernel #2. The broader issues retain
their existing acceptance criteria. Reuse the original producer/input ownership
work in Exsh #15.
Coordinate Exsh PR #3 and Kernel PR #3. Establish the
programme and lifetime proof interfaces first, then implement and review the
single-query milestone before enabling its use in the checker. Track wider
integration under Phase 6 completion.