Add dynamic interpreter handoff to ELF load plan and enforce bounded-filesystem capacity - #54
Open
thanks-cohn wants to merge 1 commit into
Conversation
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.
Motivation
ET_DYN/PT_INTERPimages can be validated and handed to a userspace interpreter without performing relocation while preserving the original strict staticplancontract forET_EXEConly.FileSystemcompile-time configurations by rejecting zeroobject_capacityand capacities that exceed theu16ObjectIdnamespace to avoid@enumFromInttruncation and invariant violations.Description
DynamicLoadPlanandplanDynamictoprojects/54-bounded-elf64-load-plan, includinginterpreterPathaccessor, new interpreter-related errors (InterpreterPathMissingTerminator,InterpreterPathContainsNul,InterpreterPathTooLong), and logic to own/validate a single NUL-terminatedPT_INTERPpathname while retainingPT_DYNAMICfor the interpreter (no relocation performed).ExecPlan.prepareinprojects/59-bounded-address-space-exec-imageto derivePT_INTERPfrom the main image viaplanDynamic, validate and load the interpreter bytes withplanDynamic, and select the correct entry (main_entryvs interpreter entry) without widening the staticplanacceptance.projects/58-bounded-filesystem/src/bounded_filesystem.zigwith@compileErrorforobject_capacity == 0andobject_capacity > (u16::MAX + 1), add twocompile_failfixtures, and addtools/check-bounded-filesystem-capacity.pyto assert the compiler rejections.generated/*,details.json,DETAILS.md,MASTERY.md,README.md,port.js) to expose the new public symbols and update validation evidence and build/test wiring.Testing
zig build check --summary allpassed (all steps) andpython3 tools/developer-command.py validate-repositorypassed the full pipeline under Zig 0.14.0.zig build test-bounded-elf64-load-planandzig build test-bounded-address-space-exec-imageran and their bundled tests (including new dynamic handoff tests) passed.PYTHONDONTWRITEBYTECODE=1 python3 tools/check-bounded-filesystem-capacity.py, which confirmed both compile-fail cases (2/2) as expected.Codex Task