mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1129] [bug] Changed behaviour of private-bin (resulting in broken apps) #775
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#775
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 @msva on GitHub (Mar 5, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1129
Somewhere between git HEAD of 12.02.2017 and current git HEAD (too much commits to bisect 😢) there was a change in the code, that changed behaviour of private-bin key.
Since that moment, some applications with "bundled" libraries (almost any application made on
electron, likeatom, newskype, discord, and so on; proprietary games; some other proprietary software; and many more) become broken (this also affects the way likefirecfgconfigures things (like/usr/local/bin/appname -> /usr/bin/firejail)).Let's take
slackapplication as example:Originally it has
/usr/bin/slack -> /usr/lib/slack/slacksymlink.And also it is linked to
libnode.solibrary, which resides in/usr/lib/slack/.Usually, likner, when
(starting an application)and(can't find libraries in "system" paths), "falls back" to looking in the directory, where the binary resides.Previously,
firejailcopied the target file into jail keeping it's original type (so, symlinks stayed symlinks, and that black magic worked).firejailwasn't try to be smarter than it is, so linker dereferenced that symlinks by itself and, in case ofslack, looked forlibnode.soin/usr/lib/slack/, and succeeded.But since some commit between dates specified above,
firejailstarted to copy target as binary (i.e. started to dereference symlinks), and not keeping original type.So, symlinks in private-bin become binary, and now linker tries to load
libnode.sofrom/usr/bin(because it is nothing to dereference, so it takes/usr/binas the path where binary resides), and, obviously, fails to load thatlibnode.so.I don't know the reason why did you change this behaviour, so I can't advice a proper way to fix that.
Mostly simple way — will be to roll back to old behaviour, with keeping symlinks as symlinks. But it, probably, have some security issues.
The best way will be to pollute
ld.so.conf, but it has some issues too:/etc/ld.co.conf, but with some otherlibcs thanglibc|musl|uClibc(like, maybe android) it can be another paths. So, tracking all the possible paths of ld.so.conf may become a pain in the ass.firejailshould also parse it's syntax (takeincludedirs and add them to whitelist)Maybe it is some other ways, but I don't see them ATM.
@Fred-Barclay commented on GitHub (Mar 6, 2017):
I was experiencing this too! Looks like you beat me to the report. 😄
@msva commented on GitHub (Mar 7, 2017):
By the way, @netblue30, it affects even firefox:
@netblue30 commented on GitHub (Mar 7, 2017):
Fixed!
I added support to follow links in --private-bin a few days ago, enabled by default. I modified the default to "disabled" - it can be controlled from /etc/firejail/firejail.config. Thanks for letting me know.