shim: When using native runtime, load liblsi-intercept in LD_AUDIT

liblsi-intercept has a simple job of stopping Steam from trying to
replace all of the system libraries in a mish-mash approach. Even when
we have STEAM_RUNTIME=0, and even with the advent of the new "prefer host
libraries" system, the internal replacements and pinning system actually
break massively.

To counteract this issue, we use our own rtld-audit implementation when
launching the real Steam, which will severely restrict which libraries the
main Steam binaries are actually allowed to load. This is on a whitelist
basis and ensures that the host libraries will be used where appropriate,
i.e. SDL, X11, etc. This prevents compatibility issues as well as the random
crashes we're now seeing with Steam beta.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2017-10-10 22:31:25 +01:00
parent 93b0f82279
commit a61e22d677
+7
View File
@@ -26,6 +26,12 @@
*/
#define EMUL32BIN "linux32"
/**
* Audit path is used for the libintercept library to ensure Steam only uses the
* host SDL, etc.
*/
#define AUDIT_PATH "/usr/\$LIB/liblsi-intercept.so"
int main(int argc, char **argv)
{
LsiConfig config = { 0 };
@@ -59,6 +65,7 @@ int main(int argc, char **argv)
if (config.use_native_runtime) {
/* Explicitly disable the runtime */
setenv("STEAM_RUNTIME", "0", 1);
setenv("LD_AUDIT", AUDIT_PATH, 1);
} else {
/* Only preload when needed. */
if (lsi_system_requires_preload()) {