Draft
Conversation
Add a wrapper that sets LD_PRELOAD=.../shmoverride.so. Since suid binaries are not involved with Xwayland, it can be a simple shell script. Place the wrapper as Xwayland in /usr/libexec/qubes/wrappers. Processes that are supposed to use it need to have /usr/libexec/qubes/wrappers prepended to PATH. QubesOS/qubes-issues#8515
If shmoverride init fails to take the lock, it likely means it is used by currently running process - do _not_ remove the file in such a case. This may happen if LD_PRELOAD leaks to child processes (which seems to happend on Xwayland when shmoverride is linked with -z initfirst). But also, if X server is started several times for some reason (for example user calls it manually), it will abort, but not early enough to skip shmoverride init. QubesOS/qubes-issues#8515
Look for display number as the first thing after stuff necessary to work in passive mode. This will be relevant for filtering which process gets shmoverride enabled. QubesOS/qubes-issues#8515
This allows setting LD_PRELOAD earlier for some parent process, and have it actually applied to selected child process. This is especially helpful for Xwayland that is started by the wayland compositor and rarely has an option to change binary path (contrary to display managers starting Xorg). This feature allows setting LD_PRELOAD on the compositor itself, and have it affected only Xwayland process. Note, this feature does not work if shmoverride is linked with -z initfirst, as getenv()/unsetenv() are not working in that case. QubesOS/qubes-issues#8515
f9184b5 to
5c6b39e
Compare
Member
Author
|
This does not work with kwin. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support adding LD_PRELOAD to a parent process too (for example wayland compositor that only later will start Xwayland). See commit messages for details.
Note, this approach does not work together with linking with -z initfirst.
Built on top of #151