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

Stubs and preload DSOs suffer duplication #5

Open
stephenrkell opened this issue Feb 17, 2021 · 2 comments
Open

Stubs and preload DSOs suffer duplication #5

stephenrkell opened this issue Feb 17, 2021 · 2 comments

Comments

@stephenrkell
Copy link
Owner

The shadow space has caused our stubs library to become not-so-minimal. It relies on mmap nudging, so depends on parts of liballocs, but it should be possible to make it avoid most duplication. This is also important for use of RTLD_NEXT -- we don't want a second copy of any of wrappers which use this.

@stephenrkell
Copy link
Owner Author

Non-obvious explanation: our preload wrappers don't compose because of the __avoid_libdl_calls hack. Once one of them is told not to make libdl calls, it will conservatively avoid downcalling (say to orig_dl_iterate_phdr) even if its callee is not the libdl version. This might be broken logic.

@stephenrkell
Copy link
Owner Author

Probably the right thing is to refactor so that the core runtime is in the _stubs.so, and the preload lib is just a minimal selection of hook points. But how does this design play with liballocs? And with the idea that we want to be our own ld.so, rather than a preload library?

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

No branches or pull requests

1 participant