mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3421] Whitelisted FUSE mounted directory can not be accessed #2151
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#2151
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 @dlehmenk on GitHub (May 17, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3421
Bug and expected behavior
I want to add a different folder for my thunderbird profile, which should be placed inside
${HOME}/some/dir. The directorysomeis FUSE mounted with gocryptfs on top of my also FUSE mounted home dir.I copied
thunderbird.profileto~/.config/firejail/and added(I tried with and without
noblacklist). The directory becomes then visible from inside thunderbird, but all data (aka my newly created profile) stored there is deleted when thunderbird is closed.I think this might be somewhat expected behavior, since it's mentioned in the wiki, but I could not find any other information on what else to do.
Environment
Ubuntu 20.04 and firejail 0.9.62
@ghost commented on GitHub (May 17, 2020):
noblacklist only makes sense if the specified path is blacklisted in one of firejail's other files, usualy one of the disable-*.inc files. You can add
blacklist ${HOME}/some/dirto a disable-programs.local file to keep the same functionality as yoy get when using the default ${HOME}/.thunderbird.As to why your 'new' TB profile data is deleted I'm not sure. Did you start TB from the command-line (with or without the -P flag)? If you used firecfg and you have a generated thunderbird.desktop file in ${HOME}/.local/share/applications it's possible that it still uses the original TB profile. Bottom-line: we need additional info from you to get to the bottom of this.
@dlehmenk commented on GitHub (May 17, 2020):
Sorry, I missed a very obvious and important detail: The folder I try to use is not on the same filesystem as my home. It's a FUSE mounted directory (gocryptfs) on top of my, also FUSE mounted, home directory. When using a normal folder in my home, everything works as expected. Sorry, I tried this yesterday night and forgot to check this.
Also I'm starting thunderbird from the command line,
-Por not makes no difference.@ghost commented on GitHub (May 17, 2020):
No apologies needed, those things happen. Can you tell us the mountpoint of that gocryptfs dir? If it is somewhere under /media or /mnt you'll need to disable
disable-mnt, which stems from the included firefox-common.profile. So either use the CLI syntax--ignore=disable-mntor comment the 'disable-mnt' option in ${HOME}/.config/firejail/thunderbird.profile. In case that still doesn't fix things, please post the --debug output here to save some time.@dlehmenk commented on GitHub (May 17, 2020):
Yes, the crypted directory is stored under /media, unfortunately
--ignore=disable-mntdid not work. I have attached the result offirejail --ignore=disable-mnt --debug thunderbird > firejail-tb-dbg.txtfirejail-tb-dbg.txt
@ghost commented on GitHub (May 17, 2020):
To be honest I'm a bit confused by the debug output. Lines 561-563 suggest the disable-mnt option is still functional. For the moment I can only suggest explicitly whitelisting /media and /media/the/gocryptfs/mountpoint.
@dlehmenk commented on GitHub (May 18, 2020):
I sepcified
in the profile and in the debug log the lines about disabling /media vanished and now show (beside other things)
Sadly this didn't work either.
I had a closer look at the directory and I can see the path I specified with the
mkdircommand inside TB, but no other files which lie there. So the error happens definitively when mounting the directory at the beginning and not during some write.I think the relevant log line may be
But there is no further explanation in the log. Is it possible to get a more verbose output there?
@ghost commented on GitHub (May 18, 2020):
Not unless you change the source code I'm afraid. But I agree on the relevancy of that message. Might be a bug in the whitelist code, or in the mkdir command. Check ownership and permissions of those files and try without the mkdir line for ${HOME}/some/dir.
@dlehmenk commented on GitHub (May 19, 2020):
Hm, the permissions are alright (owned by me, 750). If I omit the
mkdirline the directory does not show up at all. I will have a look at the code, but the last time I touched C was some years ago, so I'm not too optimistic.I noticed something entirely different though (should I create a new issue for that?): If I open Thunderbird with a TB profile which is stored in ~/.thunderbird, and ~/some is not mounted, firejail creates ~/some/dir because of the
mkdirline. gocryptfs then cannot mount it the next time I want to use it because the directory is not empty. Is there a workaround for this?@ghost commented on GitHub (May 19, 2020):
I use gocryptfs myself and know what you mean. Have you tried its
-nonemptyflag yet? It's supposed to be useful in situations like these. Tonight I have some more time to try to reproduce your issue (and #3420), which I haven't been able to yet unfortunately. As soon as I have relevant input I'll keep adding to this thread, so - for now at least - I don't think there's a need to open a seperate issue.@dlehmenk commented on GitHub (May 19, 2020):
Ah, no, I didn't know about it, that will work for me :)
One last addition before I'm also out of ideas for now: I tried mounting the crypted folder under /mnt/ and whitelistet it (to rule out the nested FUSE mounts) and it did not work either. So the problem seems to be with gocryptfs, which is very strange, because my home also uses that and TB+FJ works for profiles in ~/.thunderbird..
Anyway, thank you very much for your time and and effort looking into this!
@ghost commented on GitHub (May 19, 2020):
After some more experimenting I tend to agree. Which isn't good news for what you originally wanted to achieve. The only way I could get and keep a gocryptfs-encrypted TB profile working with firejail was to FUSE mount
${HOME}/some/dir(instead of ${HOME}/some). And even then I had to cripple the thunderbird.profile so much that it stopped being useful. Not that I fully understand why exactly. Let's hope other collaborators bring in fresh eyes on this, I'm running around in circles for the moment.@rusty-snake commented on GitHub (May 21, 2020):
In general FUSE mounted w/o
allow_rootorallow_othercan not work with firejail (it would hardfail then). This seems to to happen here.You could try to create a test profile like and then start
firejail --profile=test_tb_gocryptfs.profile bash.test_tb_gocryptfs.profil:@dlehmenk commented on GitHub (May 22, 2020):
Yes, thank you! That was the mistake. I just didn't thought of the -allow_other flag, which I of course used for my home. Thank you both for your time looking at this.