mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4387] Error mounting tmpfs: fs.c:499 fs_tmpfs: Invalid argument Error: proc 22812 cannot sync with peer: unexpected EOF #2649
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#2649
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 @darmon77 on GitHub (Jul 7, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4387
Running having unexpected behavior in its default configuration in all its profiles.
firejail telegram-desktop
Reading profile /etc/firejail/telegram-desktop.profile
Reading profile /etc/firejail/telegram.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-shell.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-common.inc
Reading profile /etc/firejail/whitelist-runuser-common.inc
Reading profile /etc/firejail/whitelist-usr-share-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Warning: private-cache feature is disabled in Firejail configuration file
Warning: private-etc feature is disabled in Firejail configuration file
Parent pid 22812, child pid 22815
Warning: cannot find /dev/null/utmp
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Error mounting tmpfs: fs.c:499 fs_tmpfs: Invalid argument
Error: proc 22812 cannot sync with peer: unexpected EOF
Peer 22815 unexpectedly exited with status 1
firejail --debug telegram-desktop
Mounting tmpfs on /usr/share, check owner: no
Error mounting tmpfs: fs.c:499 fs_tmpfs: Invalid argument
Error: proc 22956 cannot sync with peer: unexpected EOF
Peer 22959 unexpectedly exited with status 1
Environment
LSB Version: 1.0
Distributor ID: VoidLinux
Description: Void Linux
Release: rolling
Codename: void
firejail version 0.9.66
Compile time support:
- always force nonewprivs support is disabled
- AppArmor support is enabled
- AppImage support is enabled
- chroot support is enabled
- D-BUS proxy support is enabled
- file and directory whitelisting support is enabled
- file transfer support is enabled
- firetunnel support is enabled
- networking support is enabled
- output logging is enabled
- overlayfs support is disabled
- private-home support is enabled
- private-cache and tmpfs as user enabled
- SELinux support is disabled
- user namespace support is enabled
- X11 sandboxing support is enabled
@smitsohu commented on GitHub (Jul 12, 2021):
Hi @darmon77, thanks for reporting this.
Can you please post the output of
@darmon77 commented on GitHub (Jul 12, 2021):
root@dennis:|⇒ ls -ld /usr /usr/share
drwxr-xr-x 10 root root 4096 Feb 10 01:25 /usr
drwxr-xr-x 220 root root 4096 Jul 2 23:09 /usr/share
root@dennis|⇒ findmnt --target /usr/share
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/data77--vg-root ext4 rw,relatime
@D-RX commented on GitHub (Jul 13, 2021):
Same problem on Void Linux, using musl, but with just:
firejail firefoxError output is essentially the same.
I've run
straceandgdbon firejail with the args set to firefox. The problem is in the call tomountin fs.c:498 (functionfs_tmpfs). Arguments to mount are:source (rdi) => "tmpfs"
target (rsi) => "/proc/self/fd/8", which is a symbolic link to /usr/share
filesystem (rdx) => "tmpfs"
mountflags (r10) = 0x1
data (r8) => "mode=755,uid=0,gid=0"
The call to mount returns
EINVALor -1.The stack trace shows that this is called from
tmpfs_topdirs, which was called fromfs_whitelistin a child process__cloned from firejail.straceshows that there are several successful calls tomountwith filesystem set to "tmpfs" before this.I have essentially the same output as darmon77 to (just a different device name from
fndmnt):@smitsohu commented on GitHub (Jul 13, 2021):
At first I thought we are carrying over a mountflag that is not compatible with
tmpfs, but this doesn't seem to be the case.Instead we have wrong mountflags, which is a separate and possibly related bug:
0x1is the read-only flag, which Firejail actually is supposed to remove:110a74f094/src/firejail/fs.c (L488-L492)@smitsohu commented on GitHub (Jul 13, 2021):
Just for the record, I cannot reproduce on Debian or Fedora at the moment.
@D-RX commented on GitHub (Jul 13, 2021):
Sorry, there was a mistake in my earlier post. The value in mountflags for the
mountsyscall should actually be0x26. I was looking at the call tomountjust at line fs.c:498, but stepped by line rather than instruction. Following to thesyscallby instruction shows that mountflags (r10) is set to0x26(from rcx) just before thesyscallinstruction (the rcx vs. r10 is just user-space vs. kernel-space calling conventions). The return value from thesyscalltomountis-22(decimal).Also, I understand that this bug does not appear in Void Linux when using glibc, but only when using musl.
@smitsohu commented on GitHub (Jul 13, 2021):
Thanks. We need to remove
MS_REMOUNT. I'll put a fix shortly.@D-RX commented on GitHub (Jul 20, 2021):
I can verify that modifying the value
ANDed with the mount flags in the firejail binary to effect the same as your commitba5f5c8i.e. to include clearingMS_REMOUNT:unsigned long flags = buf.f_flag & ~(MS_RDONLY|MS_BIND|MS_REMOUNT);(that is, the
ANDed value goes from... FF EF FE->... FF EF DE)does fix the bug in Void Linux using musl.
Thanks!
@smitsohu commented on GitHub (Jul 22, 2021):
Guess we can close if there is nothing left to do. Thanks everyone!