mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #5938] 0ad: error while loading shared libraries: libmozjs-78.so.0 (OpenSUSE Tumbleweed) #3138
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#3138
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 @leukimi on GitHub (Aug 2, 2023).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5938
Solution
Working
0ad.profilefor OpenSUSE TumbleweedDescription
Output when run
firejail 0adon OpenSUSE Tumbleweed./usr/local/bin/pyrogenesis: error while loading shared libraries: libmozjs-78.so.0: cannot open shared object file: Permission deniedSteps to Reproduce
Steps to reproduce the behavior
0adfrom software.opensuse.org (link to 0ad package)LC_ALL=C firejail 0adBehavior without a profile
Program window opens as expected.
Environment
firejail version 0.9.72Checklist
Log
Output of
LC_ALL=C firejail 0ad@ghost commented on GitHub (Aug 2, 2023):
Hi, I cannot reproduce on Arch Linux. 0ad starts fine when sandboxed here. Its profile includes
disable-interpreters.inc, which blacklists libmozjs-*:95184d8c2e/etc/inc/disable-interpreters.inc (L22-L24)That doesn't stop 0ad on my box, but perhaps openSUSE puts files in different places. Can you try adding
include allow-gjs.inc(which undoes the libmozjs-* blacklisting)?95184d8c2e/etc/inc/allow-gjs.inc (L1-L12)@leukimi commented on GitHub (Aug 3, 2023):
I tested the suggestion and it does not change the outcome on OpenSUSE Tumbleweed. Still the same error reported. Maybe a virtual machine with OpenSUSE Tumbleweed could provide a test environment.
@ghost commented on GitHub (Aug 3, 2023):
I'll see what I can do with OpenSUSE Tumbleweed. What I noticed before but didn't ask is the path mentioned in the error message:
/usr/local/bin/pyrogenesis: error while loading shared libraries: libmozjs-78.so.0: cannot open shared object file: Permission deniedIs it normal for OpenSUSE (Tumbleweed or otherwise) to place the 0ad executables in
/usr/local/bin? I'd expected those to reside under /usr/bin. When users (or packagers) enablefirecfgthere will be symlinks under /usr/local/bin with the same name. That can be a bit confusing and is why we ask in the issue template to use full paths (to avoid attempting to run the sandbox twice). DoesLC_ALL=C firejail /usr/bin/0adproduce the same error?@leukimi commented on GitHub (Aug 4, 2023):
The SPEC file puts executables in
/usr/binas you say. In fact/usr/local/bin/pyrogenesisdoes not even exist on the system, even though the error log says so.LC_ALL=C firejail /usr/bin/0adproduces the exact same error.Investigating a bit into this I found out that there are two different
libmozjs:@ghost commented on GitHub (Aug 5, 2023):
My hardware simply is not fit for VM's but I did manage to boot a Live Tumbleweed ISO from grub2. Had to add a large enough persistent overlay to cover the size of 0ad-data. Anyway, regarding the issue, I only had to noblacklist the libmozjs-* files similarly as what allow-gjs.inc does to get 0ad going:
But as you stated earlier that
include allow-gjs.incdidn't work for you there must be something else involved that I cannot see (yet). So back to a few basic questions. Are other applications running with firejail as expected? Have you ransudo firecfg? Is your user in thefirejailgroup as OpenSUSE wisely expects?Perhaps check for symlinks as well via find's
-Lflag.Using
which -a foomight be better for debugging.@leukimi commented on GitHub (Aug 5, 2023):
Working 0ad profile on OpenSUSE Tumbleweed
Expand to see working 0ad profile for OpenSUSE Tumbleweed
Answers to questions and steps of resolution
a)
sudo firecfgdid not change a thing still causing the same error message. The user who runs0adis listed in file/etc/firejail/firejail.usersb)
find / -L -name pyrogenesis 2>/dev/nullgives no result. The error message above in first post containing/usr/local/bin/pyrogenesiscannot be detected. Maybe/usr/local/bin/pyrogenesisexists a short while and could be detected with some kind of filemonitor looking into the directory.c) I can't remember if or when I ran
sudo firecfgearlier 2023 but I sure did now before finally editing the0ad.profileadding the lines (also tried to place the lines in various places in the profile with successful launch of0adas result):The full working profile is attached at top of this message for reference.
For further testing, adding
include allow-gjs.incat the exact correct spot in the profile might resolve everything. I tried to put it in various places, but did not get0adto launch with addinginclude allow-gjs.inc. I verified that the file was read, but it did not avoid exiting the process.It appears to me that the order of code in the profile may matter. It would help if firejail somehow could display the full profile, with all alterations that is in effective use. If one include file blacklists a file and another include file noblacklists the same file, the user would like to know if the file is being blacklisted or not by firejail. As it appears to me, the first include file that does something, whatever that may be, has the higher vote and all other include files that alter this behavior will not have any effect. I arrive at the conclusion by the first line, which gives a local adaptation
~/.config/firejail/0ad.localpreference. I am not sure if my assumption is correct, but it looks that order of lines in the different files plays a significant role. In for example bash script, the last definition of a variable is the one that will have final say, whereas in firejail it seems to be the first definition that has the final say.I still have the pending question why a firejail
0ad.profileneeds to be adapted to the linux distribution. If there is no error on Archlinux or Manjaro, why is this an issue in OpenSUSE Tumbleweed. Same software, same files, different result. If it has to do with the way packages are built, if it is via AUR (builds locally on the machine) or via OBS Build Service (builds on a clone in the cloud somewhere), I don't know why this happens in the first place. One idea could be that0adon Archlinux does not need to uselibmozjs-*library for some reason, while0adon OpenSUSE Tumbleweed relies onlibmozjs-*library.For future reference it would be good to in sufficient detail describe how exactly did you start OpenSUSE Tumbleweed live CD with how big persistent overlay for 0ad data so that your insight does not have to be reinvented next time there is a troubleshooting need with OpenSUSE Tumbleweed. I could not find a guide for it (yet).
@rusty-snake commented on GitHub (Aug 5, 2023):
b) If somethings can write to a system directory you have other problems. I expect it to be an bad way to query the binary path. Something like
$(dirname /usr/locale/bin/0ad)/pyrogenisis.c) Firejail profiles are imperative not declarative. You are right that 1. order matters and 2. the first occurrence of
(no)blacklistwins. However this is not always the case, forread-only/read-writethe last occurrence wins and forprotocolit accumulates unless you specify+-=operators. Also note that some options influence each other.@ghost commented on GitHub (Aug 6, 2023):
Sure, inotifywatch for example could be used for that. The sole reference to
pyrogenesisin the Firejail universe is in the 0ad.profile's private-bin. There is a setting infirejail.configfor hiding /usr/local/bin items from private-bin. But that's disabled by default so I guess you'd know if you touched and changed that.5e0f35b0cb/etc/firejail.config (L89-L90)Nothing exceptional here. All due to firecfg symlinking and the FHS.
Cfr. @rusty-snake above. Because disable-interpreters.inc blacklists libmozjs-* there's only one place for it, namely before the line that includes that file :)
One could use the
--debugoption for that. I can see how having such a basic 'this-is-it' overview of the active sandbox would be a nice feature.List 0ad's needed libraries:
$ readelf -d /usr/bin/0ad | grep NEEDED | cut -f2 -d[ | cut -f1 -d] | sort
I'll put some notes together and post a link here.
Now you've got a fix, can you open a PR for this?
@leukimi commented on GitHub (Aug 6, 2023):
I also now successfully tested to use line:
include allow-gjs.incbefore line:
include disable-interpreters.incas I may have put it after the said line before, not knowing that the first include file with
noblacklistwins over the latter.I have updated the working
0ad.profileabove accordingly.Need help to file a correct PR
I looked at the templates for issue reporting and could not deduce how a PR is initiated and how exactly to point out that this issue may only occur on OpenSUSE Tumbleweed. I honestly don't know how a PR is made nor what it stands for. My humble guess is it may be an acronym for "Profile Request". I can't find the way to do it, so I humbly ask for help with further steps and approve someone who knows puts a PR in the correct way on my behalf.
Hopefully this issue leads to the 0ad package/software code being updated so that the same profile that ships for Archlinux also works in OpenSUSE Tumbleweed without modifications.
I also close the issue and add the solution to the top message in case someone looks for a solution.
@rusty-snake commented on GitHub (Aug 6, 2023):
PR = Pull Request
GitHub Docs: https://docs.github.com/en/pull-requests
@rusty-snake commented on GitHub (Aug 6, 2023):
You can start with navigating to the (pro)file on github, click the edit button and follow the suggested steps.
@leukimi commented on GitHub (Aug 6, 2023):
I have created a fork and pasted the working code as a suggestion to a pull request for commit along with a short description on why to the merger and a link to this thread for further information if it is needed. Thank you both for all your help in figuring out how to fix this
0ad.profileissue on OpenSUSE Tumbleweed. It's been a learning experience.@ghost commented on GitHub (Aug 8, 2023):
@leukimi Here's my notes on how to create a Tumbleweed ISO with persistence.