musec / libpreopen

Library for wrapping libc functions that require ambient authority
84 stars 8 forks source link

dlopen support #8

Closed valpackett closed 5 years ago

valpackett commented 6 years ago

In order to externally capsicumize some applications, especially desktop ones (e.g. anything GTK3 based), we need to support dlopen.

In my horrific hack that I made before discovering libpreopen, it is implemented as fdlopen, but with a manual pre-loading of ELF dependencies using the ELF parser to find them. :D And it does work, I can start GTK3 under both X and Wayland after cap_enter.

Do you have any ideas for better, cleaner, reliable dlopen support?

valpackett commented 5 years ago

Turns out just wrapping dlopen and letting rtld pick up dependencies from the "static" fds (when doing the explicit rtld exec) is pretty good. Closing in favor of PR #9