Don't require ld-linux.so.2 to be inside ChrootSetuidJail

Status: in progress

Stop putting ld-linux.so.2 (the dynamic linker) inside the fixed chroot jail that is part of ChrootSetuidJail. This executable currently needs to be present inside the chroot so that we have an executable to invoke via execve(), because Linux does not provide an fexecve() system call that takes a file descriptor instead of a filename. Having the dynamic linker inside the chroot is problematic because it is part of PlashGlibc. It makes it hard to use different versions of PlashGlibc.

We could use a generic ELF loader instead. The loader can take a file descriptor for ld-linux.so.2 instead of a filename. It would not need to use the PlashObjectCapabilityProtocol, because that would defeat the object of making ChrootSetuidJail independent of changes to the comms protocol. The ELF loader could load the executable as well, but that is not essential because ld-linux.so.2 already knows how to load the executable.

The ELF loader could be based on rtldi.

This could have a performance impact. We should try to measure that, and set up ContinuousIntegration to measure this continuously.

See also UserModeExec.

See the ELF ABI documentation:

Background

Normally doing exec on a normal dynamically-linked ELF executable works like this:

With Plash, before this story, this becomes:

After this story, this becomes:

Tasks

ELF chainloader:

Hook up the chainloader:

How should FsOp and pola-run find ld.so?

Docs:

Testing

The test suite (all_tests.py) can be run in two ways: with or without wrapping it in run-uninstalled.sh. The latter would test with ChrootSetuidJail. Currently not all tests pass when not using run-uninstalled.sh, because pola-run-c and pola-shell are not installed (but are tested). How should we resolve that? Options:

Notes

See Story16Notes for chronological notes.

Questions

Would there be any advantages to using uclibc instead of dietlibc?

Story16 (last edited 2008-06-05 18:17:05 by MarkSeaborn)