Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ELF binfmt loader #79

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

michpappas
Copy link
Member

unikraft/unikraft#1386 implements execve() via the newly introduced libukbinfmt, which allows the registration of loaders of different binary file formats. This PR introduces the ELF binfmt loader, which is used internally by execve().

GitHub-Depends-On: #73
GitHub-Depends-On: #77

elf_ctx.c Outdated Show resolved Hide resolved
elf_ctx.c Show resolved Hide resolved
elf_ctx.c Outdated Show resolved Hide resolved
elf_ctx.c Outdated Show resolved Hide resolved
elf_ctx.c Outdated Show resolved Hide resolved
elf_binfmt.c Outdated Show resolved Hide resolved
elf_binfmt.c Show resolved Hide resolved
elf_binfmt.c Outdated Show resolved Hide resolved
elf_binfmt.c Outdated Show resolved Hide resolved
elf_binfmt.c Outdated Show resolved Hide resolved
POSIX defines the minimum total size of argv + envp to ARG_MAX,
and leaves the inclusion of NULL terminators, pointers and / or
alignment bytes as implementation defined. The policy we implement is:

- Permit the total length to exceed ARG_MAX as long as it's not
  greater than 1/4 of the stack size. This is essentially the same
  policy as linux (see execve(2)), with the difference that we
  don't apply the MAX_ARG_STRLEN floor of 32 pages.

- Exclude auxv, NULL, andlignment bytes from the checked size, as
  these are of fixed size and occupy an insignificant portion of
  the stack.

Signed-off-by: Michalis Pappas <[email protected]>
Add binfmt loader for ELF. This is the default loader used on
execve().

Signed-off-by: Michalis Pappas <[email protected]>
Copy link
Member

@mogasergiu mogasergiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Sergiu Moga [email protected]

@razvand razvand requested a review from StefanJum August 19, 2024 08:55
@razvand razvand self-assigned this Aug 19, 2024
@razvand razvand added the enhancement New feature or request label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants