Commit Graph

196 Commits

Author SHA1 Message Date
Ikey Doherty b40eba8ad9 Further deduplication (get_process_name, file_exists)
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-22 00:18:55 +01:00
Ikey Doherty 1179763531 redirect: Don't dupe lsi_file_exists
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-22 00:16:16 +01:00
Ikey Doherty 627c7639cf Stop building nica lots, build it once inside lsi_common
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-22 00:14:38 +01:00
Ikey Doherty 290260c09e Move common.h into common library
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-22 00:12:04 +01:00
Ikey Doherty a691985541 Dedupe, implement support for getting steam directory
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-22 00:10:49 +01:00
Ikey Doherty 1811ff5225 lsi: Dedupe into common
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-22 00:03:51 +01:00
Ikey Doherty a932486826 Start splitting out a new common library
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-22 00:02:18 +01:00
Ikey Doherty 3c69b6dc05 Switch to C11 so we get unnamed structs/unions
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 20:25:25 +01:00
Ikey Doherty c8f0cecb15 redirect: Start designing the generic ops table
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 20:24:57 +01:00
Ikey Doherty 3b01919148 shim: Set LD_PRELOAD for libredirect if enabled
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 19:46:25 +01:00
Ikey Doherty 474aca0b69 lsi: Teach config how to handle toggle on libredirect
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 19:46:13 +01:00
Ikey Doherty fa81893d41 Be a little bit less verbose
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 19:19:27 +01:00
Ikey Doherty f958b8ac3f redirect: Cheeky initial hack to see if we can replace paths
This is a very ugly hack right now but we'll prettify it and make
it all more generic, but right now it'll hotswap the depthblur
in Ark for the one coming from "TheCenter" mod.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 19:18:30 +01:00
Ikey Doherty 971d0c280e redirect: Temporarily teach it about ShooterGame for debugging
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 19:02:58 +01:00
Ikey Doherty 4f6166bdce redirect: Add basic code path for "if lsi_override"
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 18:44:09 +01:00
Ikey Doherty be98e146ed redirect: Differentiate between table + lsi redirect init
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 18:42:22 +01:00
Ikey Doherty 5c131f6b28 redirect: Fix open args for variadic functions
Also mark stuff as fatal because at this point we've override `open` ..

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 18:31:24 +01:00
Ikey Doherty 8768730414 redirect: Add our initial dlsym/dlopen dance to grab real open
Instead of relying on RTLD_NEXT we'll do the correct thing and open a
reference to libc.so.6 and load the `open` function from there, as our
linking order might be janky, causing lookups for `open` to actually fail.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 18:13:27 +01:00
Ikey Doherty 68fe3c1c11 redirect: Comments pls
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 17:58:33 +01:00
Ikey Doherty dc85a14bfb redirect: Increase chance of shutdown handler via volatile atexit
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 17:56:34 +01:00
Ikey Doherty c646ee516e redirect: Fix copy/paste issue
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 17:52:52 +01:00
Ikey Doherty bb29a04078 redirect: Add the usual get_process_name dance
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 17:52:35 +01:00
Ikey Doherty 0eb0d09119 Remove destructor for now, virtually zero chance of it ever running
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 17:49:28 +01:00
Ikey Doherty 5810e63576 Force debugoptimized as we stripped CFLAGS from Solus environment
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 17:16:43 +01:00
Ikey Doherty 01faa3754d redirect: Start skeleton for new liblsi-redirect
We're left in the awkward position that there are some games that **still**
misbehave on Linux, and generally do Dumb Things. So to get around the fact
that some vendors basically stopped caring about us, we'll create a special
`LD_PRELOAD` library that is responsible for redirecting syscalls to basically
monkeypatch broken behaviour completely.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-21 17:15:29 +01:00
Ikey Doherty b4e512b708 intercept: Allow loading CPU based swiftshader libGLESv2.so
This fixes issue #17 by whitelisting the library once more for the main
collection of binaries in the Steam client.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-19 04:37:13 +01:00
Ikey Doherty 95613a45f8 intercept: Add soname rewrite rules for remaining SDLs
This further helps with getting Outlast to work properly.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-15 20:44:38 +01:00
Ikey Doherty 312b7a888a Just group the security ones.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-15 20:39:28 +01:00
Ikey Doherty 071304d8bd Point blame to right place in comment
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-15 20:39:06 +01:00
Ikey Doherty 36e6cf5455 intercept: Prevent HyperLightDrifer loading 5 year old SSL library.
This will resolve issue #19.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-15 20:29:19 +01:00
Ikey Doherty 26dc2503d2 intercept: Add rewrite soname rule for SDL2 TTF
This should help with issue #18 but will need testing

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-15 19:38:51 +01:00
Ikey Doherty 1d81c2094f intercept: Teach liblsi-intercept to rewrite dlopen requests for XNA
We currently have a layered block and rewrite system that prevents games
from using vendored SDL, openal, core libs, etc. However the Mono games such
as Stardew Valley will locally load paths using dlopen(), which we've been
blacklisting.

When we now detect a dlopen() to the vendored paths, we'll attempt to rewrite
those to meet the system paths which then forces the dlopen() to resolve to
the system SDL, openAL, etc.

This resolves issue #16.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-15 18:23:18 +01:00
Ikey Doherty fe063b1624 intercept: Blacklist games from replacing security-sensitive libcurl
As seen in DiRT Rally, the Feral Interactive port is replacing libcurl.so.4,
which is a security sensitive library, known to update against CVEs with
frightening frequency.

Protect our users, and ensure system libcurl is used.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-13 15:48:31 +01:00
Ikey Doherty fa41b2c572 intercept: Only emit soname change when LSI_DEBUG is set
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-13 15:43:27 +01:00
Ikey Doherty feae99a359 intercept: Teach libintercept to transmute sonames for Feral Interactive games
Internally libintercept has a number of magic tricks to prevent games from
replacing the system SDL libraries with vendored ones. However, during testing
with DiRT Rally, it was discovered that Feral Interactive have altered the
sonames of their libraries and linked to those, ensuring they never match
the system versions.

This however will lead to a mixed SDL2 stack for those disabling the Steam
runtime, and in turn forces older builds of SDL to be used. To combat this,
we intercept soname requests during early linking based on a simple pattern,
and if they don't match the expected target name, we'll rewrite the request
in place to force the linker to look for the real soname.

In combination with the existing lsi_blacklist_vendor function, this ensures
that a game looking for `libSDL2-2.0.5.so` will correctly load the system's
own `libSDL2-2.0.so.0`.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-13 15:30:00 +01:00
Ikey Doherty 34fe25a533 Rename the LICENSE file as GitHub is a bit slow on that front.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-13 03:02:54 +01:00
Ikey Doherty 6349652740 intercept: Clamp down on libGL{,ES}, libGLU*, and libGLEW offenders
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-13 02:48:52 +01:00
Ikey Doherty 665caee634 Document the effects of LD_AUDIT with unpatched glibc versions
This goes some way to satisfy the concerns of issue #15 so that everyone
knows where they stand, how to mitigate this **now**, and what we intend
to do about this in future.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 16:16:10 +01:00
Ikey Doherty be3023263f Bump version to 0.5 for release
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
v0.5
2017-10-12 02:56:27 +01:00
Ikey Doherty 27e5cd0ae0 intercept: Ensure openAL isn't replaced with broken vendor libraries
We often see cases where the vendored openAL library is incapable of HRTF
due to some old or broken openAL version/build, so let's stop games doing
that with the vendor_offender mode.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 02:53:50 +01:00
Ikey Doherty 79fece840c intercept: Actually really blacklist it. Like seriously
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 02:46:05 +01:00
Ikey Doherty 478a0f1810 intercept: Hit Black Mesa with a really, really big hammer.
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 02:27:34 +01:00
Ikey Doherty 2cf5db42b3 intercept: Use private file exists function to strip nica API from exposed ABI
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 02:20:38 +01:00
Ikey Doherty 191ea02946 intercept: Remove much in the way of symbol visibility issues
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 02:19:46 +01:00
Ikey Doherty 03dd537574 intercept: Prevent "Black Mesa" from using vendored libstdc++/libSDL
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 02:06:35 +01:00
Ikey Doherty 8ded405801 intercept: Decouple hardcoding from the Steam logic
This allows us to match process names to work modes, so that we'll take one
path for Steam, and allow another path completely for "vendor offenders".

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 01:57:45 +01:00
Ikey Doherty 35b3f132fd intercept: Use globally defined tables to make it easier to extend
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-12 01:47:54 +01:00
Ikey Doherty 4b718a4bc7 shim: Always respect steam-binary option
This resolves issue #13, but requires the packagers are explicit in setting
the steam path.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-11 21:01:01 +01:00
Ikey Doherty 5ceacb27fb Post-update mkrelease script
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-11 16:26:55 +01:00
Ikey Doherty d1b7a86867 Bump version to 0.4.1
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
v0.4.1
2017-10-11 16:19:59 +01:00