feat(kernel): load exec images from VFS - #191
Merged
Merged
Conversation
Reject headers whose e_phentsize is not a full Elf64Phdr and bound each program-header read to that width before the unaligned load.
Introduce borrowed static ramfs files, roll back leaked inode slots on directory insertion failure, and add a size-bounded executable reader for the kernel exec path.
Publish static /bin/sh in rootfs, read the image from VFS first, and fall back to the embedded set only when the path is absent.
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
Publish a static
/bin/shin ramfs and makeexecveload a bounded ELF from VFS first. Embedded lookup remains only when the path is absent.Changes
[exec] loaded VFS image /bin/shafter the new address space is committedRelated Issues
None.
Checklist
cargo fmt --all -- --check— zero errorscargo clippy --workspace -- -D warnings— zero warningscargo build --workspace— succeeds///commentsunsafeblocks have// SAFETY:commentsLocal verification: 4845 host tests, strict Miri on the ELF and ramfs exec tests, and QEMU x86_64/aarch64/riscv64 including the VFS marker and interactive
/bin/catfallback.Out of scope: process credentials, EFAULT/argv/E2BIG repair, shebang, dynamic linker, setuid, and removing the embedded fallback.
Screenshots
Not applicable.