mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1590] error with private-tmp & /tmp as tmpfs #1061
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#1061
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 @step- on GitHub (Oct 5, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1590
My distro, Fatdog64, mounts /tmp on a tmpfs in RAM. It's the default setup OOTB. Firejail seems to not like it. Is there some way around it? Note that
System info
@netblue30 commented on GitHub (Oct 6, 2017):
Until we figure out what's going on, as root user open /etc/firejail/globals.local in a text editor and add "ignore private-tmp" to that file. This will disable private-tmp globally.
@step- commented on GitHub (Oct 6, 2017):
OK, thank you. This is a better temporary fix than patching all the *.profile files in /etc/firejail.
@netblue30 commented on GitHub (Oct 6, 2017):
The file is included in all profile, so it should do the job.
@jplien commented on GitHub (Oct 12, 2017):
Not sure if it's the same bug, but my /tmp is a symlink, and firejail recently started failing with:
Error: invalid whitelist path /tmp/.X11-unix
The workaround above resolved the problem for me. Maybe also related to #744 about blacklisting a symlink?
@chiraag-nataraj commented on GitHub (Jan 8, 2018):
Hmm, is this bug still valid? I actually do the same thing the OP does (mount
/tmpas a tmpfs), but my firejail works fine withprivate-tmp. @step- and @jplien, is this still an issue?@jplien commented on GitHub (Jan 9, 2018):
I just updated to 0.9.52 (Debian testing) and when I comment out "ignore private-tmp" globals.local, it fails to start firefox.
If I run with --debug I get:
Error: invalid whitelist path /tmp/.X11-unix
In my case / is my SSD, and /tmp is a symlink to my HDD (ext4) which is mounted under /mnt/.
@chiraag-nataraj commented on GitHub (Jan 9, 2018):
Does
/tmp/.X11-unixexist?@jplien commented on GitHub (Jan 9, 2018):
Yes
jplien@argos:~$ ls -ld /tmp/.X11-unix/
drwxrwxrwt 2 root root 4096 Jan 8 21:11 /tmp/.X11-unix/
@Fred-Barclay commented on GitHub (Jan 9, 2018):
@jplien Does the line
disable-mntexist in globals.local or your firefox profile?@jplien commented on GitHub (Jan 9, 2018):
I did a grep and it is in some profiles but not in firefox or firefox-esr. I checked all of the files in this list:
Found firefox-esr profile in /etc/firejail directory
Reading profile /etc/firejail/firefox-esr.profile
Reading profile /etc/firejail/globals.local
Reading profile /etc/firejail/firefox.profile
Reading profile /etc/firejail/globals.local
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/whitelist-common.inc
@step- commented on GitHub (Jan 9, 2018):
@chiraag-nataraj , it seems @jplien is on to something. This is my debug log for commit
f66ea88:and in /tmp
I guess the socket file triggers the error in fs_whitelist.c:859.
@chiraag-nataraj commented on GitHub (Jul 15, 2018):
@step- Nah, the socket shouldn't trigger that error. I have the same socket and everything works fine. Is your
/tmpalso symlinked to somewhere in/mnt?@jplien Do you happen to have
disable-mntenabled in/etc/firejail/firejail.config?@step- commented on GitHub (Jul 16, 2018):
@chiraag-nataraj
Yes, my /tmp is mounted on /mnt.
My distro, Fatdog64, mounts /tmp as a tmpfs in RAM. It's the default setup OOTB.
@chiraag-nataraj commented on GitHub (Jul 16, 2018):
@step- Mine's also a tmpfs (Debian), but that doesn't really imply it's mounted in
/mnt... Anyway, can you do the same checks we asked @jplien to do? So eitherdisable-mntin the profile file(s) ordisable-mntinfirejail.config? Meanwhile, I'll download Fatdog64 and give it a whirl.@step- commented on GitHub (Jul 16, 2018):
@chiraag-nataraj oops, you're right, it's tmpfs but it isn't mounted on /tmp. It's tmpfs on /tmp type tmpfs (rw,relatime). So I'm not goint to do the same checks you asked jplien. Waiting for further instructions.
@smitsohu commented on GitHub (Jul 16, 2018):
Can someone please run
firejail --private-tmp --debug-whitelists?EDIT: Just realized it's already there:
@step- commented on GitHub (Jul 16, 2018):
@smitsohu
@chiraag-nataraj commented on GitHub (Jul 22, 2018):
Hmmm, my X11 socket is owned by my user, not root:
@step- commented on GitHub (Jul 22, 2018):
Mine is owned by root because root is my
$USERand real identity. Fatdog64 is a sudo-less GNU/Linux multi-user system, but the default user is root and everyone is encouraged to run as root.There exists a regular user named 'spot', which I use to run browsers and other network programs. I tried running firejail as user spot without success. The terminal transcript follows.
So, several issues involving user detection on my system...
@chiraag-nataraj commented on GitHub (Jul 22, 2018):
Hmm, interesting. How did you install firejail? Compile from source?
@step- commented on GitHub (Jul 22, 2018):
Yes, I built
2bea8f6from git source. The build recipe essentially doesand adds /etc/firejail/globals.local, which reads:
@jplien commented on GitHub (Jul 24, 2018):
Yes disable-mnt is set in firefox-common.profile for me.
@chiraag-nataraj commented on GitHub (Jul 24, 2018):
@jplien Try commenting out
disable-mntand your issue should be resolved (hopefully).@chiraag-nataraj commented on GitHub (Aug 19, 2018):
@jplien Were you able to try commenting out
disable-mnt?@chiraag-nataraj commented on GitHub (May 20, 2019):
Is this still an issue for @step- and/or @jplien?
@step- commented on GitHub (May 22, 2019):
@chiraag-nataraj, yes, it is still an issue, and now there's an error message even if I add
ignore private-tmpto /etc/firejail/globals.local.I compiled the latest commit
43cbc6d.@chiraag-nataraj commented on GitHub (May 22, 2019):
Can I see the output of
findmnt?@smitsohu commented on GitHub (May 22, 2019):
@jplien @step- Whitelisting in symlinked top level directories (like /tmp in your case) is not allowed in most cases. #2041 should address this in the future, but we are not there yet.
@step-
This makes me think there is a symbolic link somewhere.
That's because of
--noprofile@chiraag-nataraj Confusingly the mounting on
/run/firejail/mnt/orig-tmpapparently first succeeds here43cbc6d5f5/src/firejail/fs_whitelist.c (L725-L730)only to fail a little later with
No such file or directory43cbc6d5f5/src/firejail/fs_whitelist.c (L993-L994)@step- commented on GitHub (May 22, 2019):
@chiraag-nataraj
@step- commented on GitHub (May 22, 2019):
@smitsohu
Even without
--noprofile@smitsohu commented on GitHub (May 22, 2019):
Ah right, there is a second reason. Profiles are parsed after the command line options. This means if you want to skip a command line option, the corresponding
--ignore=must be present on the command line.@chiraag-nataraj commented on GitHub (May 23, 2019):
Okay, so
/tmpisn't a symlink. If/tmp/.X11-unixisn't a symbolic link either, I'm very confused. Just to confirm, can you do anls -lh /tmp/.X11-unixand report back with the output?@jplien commented on GitHub (May 23, 2019):
I was still having problems with /tmp in firejail as of today. This thread spurred me to do something I'd been meaning to do for a long time: switch /tmp from a symlink to a bind mount. This seems to have resolved the issues I was having. I was able to remove ignore private-tmp from globals.local and it starts just fine now.
@step- commented on GitHub (May 23, 2019):
@smitsohu
I'm not sure why you think that my /tmp is symlinked. This is what I have:
@chiraag-nataraj commented on GitHub (May 23, 2019):
@step- How about
readlink -f /tmp/.X11-unix?@step- commented on GitHub (May 23, 2019):
@chiraag-nataraj commented on GitHub (May 23, 2019):
Looking at the code in
fs_whitelist.c, the "skip whitelisting of " lines come about when either:Question: Is your
/run/directory a symlink to anywhere?@step- commented on GitHub (May 23, 2019):
Yes, it is
@chiraag-nataraj commented on GitHub (May 23, 2019):
I think that's what's causing the issue...
firejailstores the original stuff in/run/firejail/<blah>, and...well...it can't really do that in your case. You should mount it as a separatetmpfs(not symlink it) and you should be fine.@smitsohu commented on GitHub (May 24, 2019):
Also quoting the FHS
@step- commented on GitHub (May 24, 2019):
@chiraag-nataraj @smitsohu Thank you for providing an explanation of this issue, and for the FHS quote. Fatdog64 is designed as a non-sudo GNU Linux, so its view of security is different from the mainstream view, see Fatdog64 FAQ. I will ponder your recommendations and extend them to the Fatdog64 dev team for comments. Thank you again.
@chiraag-nataraj commented on GitHub (May 24, 2019):
No problem! I'll go ahead and close this issue since it seems we (finally!) figured out what was going on. If you're still running into the problem after un-symlinking
/run, please feel free to re-open and we'll do some further debugging :)