Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On failing to remount a fuse filesystem, give warning instead of erroring out #5240

Closed
alkim0 opened this issue Jul 6, 2022 · 0 comments
Closed
Labels
enhancement New feature request

Comments

@alkim0
Copy link
Contributor

alkim0 commented Jul 6, 2022

Is your feature request related to a problem? Please describe.

I use sshfs a lot (mounts remote ssh directories locally via FUSE). Sometimes, my connection to the server isn't stable, so it will appear that the filesystem is mounted, but none of the contents are accessible (i.e., fails to fstat anything on the mounted directory). At this point, a large majority of programs sandboxed with firejail will fail to start with:

Error fstat: fs.c:534 fs_remount_simple: Input/output error
Error: proc 407052 cannot sync with peer: unexpected EOF

This will happen even for programs which access do NOT access any of the files mounted by sshfs. I feel like this should not be the case.

To give an example, say I have a sshfs mounted directory /home/me/remote-data with:

sshfs remote-server: /home/me/remote-data

Then, my connection to the server becomes flaky, but I wish to access a local pdf file:

zathura /home/me/docs/file.pdf

Zathura will fail to start with the error mentioned above.

Describe the solution you'd like

As far as I can tell, this happens because firejail will try to create a read-only mirror version of the current filesystems with these remounts, but comes across a filesystem it cannot access, and then errors out.

Ideally, instead of erroring out, I would like it to print a warning, not mount that fuse filesystem, and move on to execute the program.

Describe alternatives you've considered

Obviously, I can unmount the sshfs mounted directory, but doing this every time my remote connection gets flaky and then remounting it becomes very annoying.

In addition, starting the program with ignore noexec ${HOME} and ignore read-only ${HOME} also works (since the mirror won't be recreated), but giving up on these protections for a malfunctioning fuse filesystem seems less than ideal.

Additional context

Although the situation I have described is with sshfs, if there are any fuse filesystems with bugs in the future, this error may be raised. While these are "bugs" on the fuse side, I feel like firejail should be robust enough to not prevent me from performing actions which are completely separate from the erroring fuse filesystem.

I believe similar situations have caused issues #3473, #3280, and #3277. Restarting will often work, since it will unmounts the fuse filesystems, and the errors go away.

@alkim0 alkim0 closed this as completed Jul 12, 2022
@kmk3 kmk3 added this to To do in Release 0.9.72 via automation Jul 12, 2022
@kmk3 kmk3 moved this from To do to In progress in Release 0.9.72 Jul 12, 2022
@kmk3 kmk3 added the enhancement New feature request label Aug 1, 2022
@kmk3 kmk3 moved this from In progress to Done (on RELNOTES) in Release 0.9.72 Aug 1, 2022
ChrysoliteAzalea pushed a commit to ChrysoliteAzalea/firejail that referenced this issue Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
No open projects
Release 0.9.72
  
Done (on RELNOTES)
Development

No branches or pull requests

2 participants