Skip to content

WIP: litebox_runner_linux_userland: Support --insert-files - #1713

Open
Will Hawkins (hawkinsw) wants to merge 1 commit into
microsoft:mainfrom
hawkinsw:runner_linux_userland_insert_files
Open

Will Hawkins (hawkinsw) wants to merge 1 commit into
microsoft:mainfrom
hawkinsw:runner_linux_userland_insert_files

Conversation

@hawkinsw

Copy link
Copy Markdown

No description provided.

@hawkinsw

Copy link
Copy Markdown
Author

I found that --insert-files would be a valuable option to have implemented when using Litebox to run dynamically linked ELF files on Linux and thought I could help. Without support for --insert-files, attempting to execute a dynamically linked ELF file on Linux (e.g.,

$ ./target/debug/litebox_runner_linux_userland \
--unstable \
--rewrite-syscalls \
/usr/bin/echo testing

) resulted in

Error: failed to open the ELF file

Caused by:
    ENOENT: No such file or directory

because the files accessed by ld.so were not in the sandboxed FS.

Although the current state of the PR is WIP,

$./target/debug/litebox_runner_linux_userland \
--unstable \
--insert-file /lib64/libc.so.6 \
--insert-file /lib64/ld-linux-x86-64.so.2 \
--insert-file /usr/lib64/libtinfo.so.6 \
--rewrite-syscalls \
/usr/bin/echo testing

works:

testing

I will continue to brush up the PR and would love any feedback that you have! If, however, this implementation is not something that you want, I do not want to waste your time!

As I said before, this project is really awesome! Thank you for being so open to contributions!

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