Skip to content

feat(kernel): load exec images from VFS - #191

Merged
kernalix7 merged 3 commits into
mainfrom
feature/vfs-backed-execve
Aug 17, 2026
Merged

feat(kernel): load exec images from VFS#191
kernalix7 merged 3 commits into
mainfrom
feature/vfs-backed-execve

Conversation

@kernalix7

Copy link
Copy Markdown
Owner

Summary

Publish a static /bin/sh in ramfs and make execve load a bounded ELF from VFS first. Embedded lookup remains only when the path is absent.

Changes

  • Validate ELF64 program-header size and bound each unaligned header read
  • Add borrowed static ramfs files and a size-bounded executable reader
  • Roll back leaked static inode slots when directory insertion fails
  • Map VFS errors exhaustively and emit [exec] loaded VFS image /bin/sh after the new address space is committed

Related Issues

None.

Checklist

  • cargo fmt --all -- --check — zero errors
  • cargo clippy --workspace -- -D warnings — zero warnings
  • cargo build --workspace — succeeds
  • Public APIs are documented with /// comments
  • unsafe blocks have // SAFETY: comments
  • License header present in new files
  • Documentation updated (CHANGELOG, docs — both ko & en)
  • No hardcoded paths, credentials, or personal info

Local 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/cat fallback.

Out of scope: process credentials, EFAULT/argv/E2BIG repair, shebang, dynamic linker, setuid, and removing the embedded fallback.

Screenshots

Not applicable.

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.
@kernalix7
kernalix7 merged commit 71503b0 into main Aug 17, 2026
3 checks passed
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