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
[Question]: What is the recommend method to have LD_PRELOAD honored by flatpak applications? #5617
Comments
Specifically this would be useful to LD_PRELOAD hardened_malloc, a security-focused general purpose memory allocator. |
related: |
The recommended method is "don't". Any native code that exists on the host system OS distribution can legitimately have dependencies on libraries in the host system OS distribution that do not exist, or exist but are too old or incompatible, inside the Flatpak runtime. If you want to inject arbitrary code into programs running inside the Flatpak sandbox (whether that's a hardened, instrumented or otherwise modified malloc(), some other LD_PRELOAD module like faketime, a Vulkan layer like MangoHUD, or any other similar thing) then it needs to be compiled against the Flatpak runtime's dependency libraries and shipped as a Flatpak extension. An extension is a special runtime that acts like a plugin for other apps and runtimes. |
@smcv Thanks again. I'll be pursuing the extension route. To be clear though, in this specific case the hardened_malloc lib doesn't depend on anything else so for this specific use case it works fine. But I understand why this may well not be the case for other libraries. |
A malloc implementation presumably needs some way to ask the kernel for more memory, which I imagine is using system calls like It might only be using ABI entry points that have existed since time immemorial (like |
question answered |
Checklist
Suggestion
There is a partially related comment I made here: #5575 (comment)
But that doesn't fully capture the question. The question is, what is the method recommended by flatpak officially to have LD_PRELOAD honored by flatpak applications?
The text was updated successfully, but these errors were encountered: