mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #460] LD_PRELOAD and Firejail #326
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#326
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Apr 20, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/460
I'm trying to run Steam with a custom command and with Firejail, but I'm unable to do so.
Because Steam can't properly detect/load the Radeon libraries, you either need to delete a few libraries from Steam's runtime, or start it with the following command:
LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1 /usr/$LIB/libasound.so.2 '${LD_PRELOAD} steam
However, I can't do that with Firejail.
I tried editing Steam's profile:
Also, I tried:
With no luck:
Does anyone have any idea how to do this?
@ruany commented on GitHub (Apr 23, 2016):
This should work:
firejail sh -c "LD_PRELOAD='...' steam"It would be a security risk if users could run SUID binaries with LD_PRELOAD, since they can inject whatever code they want into the (dynamically linked) binary which runs as root.
Though it would be possible for Firejail to pass on its own environment variable as LD_PRELOAD (e.g. $FIREJAIL_LD_PRELOAD), this is already possible by setting the variables in a subshell.
@alexbakker commented on GitHub (Apr 25, 2016):
I use the following script that I put it /usr/local/bin/:
@netblue30 commented on GitHub (Apr 25, 2016):
@Impyy: does it work with ---env=LD_PRELOAD[...]?
@alexbakker commented on GitHub (Apr 25, 2016):
@netblue30 It does for me.
@netblue30 commented on GitHub (Apr 25, 2016):
thanks!
@ghost commented on GitHub (Apr 26, 2016):
@netblue30 Would you consider using LD_PRELOAD an actually security risk?
@ruany commented on GitHub (Apr 27, 2016):
@amarildojr It's not a security risk, it's just prevented on SUID binaries because it would be a security risk in that case. Very few binaries are setuid root (including firejail), and regular users cannot use LD_PRELOAD on setuid binaries because it would allow them to execute arbitrary code as root.
I'd suggest using the --env option, didn't know it existed, looks cleaner than my solution.
@netblue30 commented on GitHub (Apr 27, 2016):
If you start as a regular user, LD_PRELOAD is disabled automatically by the kernel on SUID binaries, so firejail runs without LD_PRELOAD. It will install LD_PRELOAD inside the sandbox as requested, and monitor it with a seccomp filter. The level of risk is higher, hopefully seccomp does its job to mitigate it - that's the theory. Don't use LD_PRELOAD unless you have a good reason to do it.
@ghost commented on GitHub (Apr 27, 2016):
Thanks, I'm not using LD_PRELOAD anymore, I simply decided to delete some libraries from Steam's runtime, this way it will load these libraries from the OS.
@netblue30 commented on GitHub (Apr 28, 2016):
Cool!