mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3224] Firejail not tearing down sandbox after closing VLC #2022
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#2022
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 @Futureknows on GitHub (Feb 14, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3224
I've noticed a few apps do this when jailed. The app appears to close, but upon inspection the sandbox is still running. With VLC it prevents a new instance from launching until I manually kill the sandbox or the orphaned process.
Has anyone else noticed this behaviour?
@jonleivent commented on GitHub (Feb 14, 2020):
I have seen this with zombie processes. Firejail keeps jails open if the app that was originally jailed created zombies when it was shut down. These are easy to spot with firetools fstat tool - they show up as jailed processes that use no memory.
@Futureknows commented on GitHub (Feb 14, 2020):
Thanks. I wonder what might help prevent it, maybe loosening the sandbox? I'll look for common parameters in the offending firejails.
@jonleivent commented on GitHub (Feb 14, 2020):
I strongly doubt that changing the sandbox parameters will have any effect. If it is a zombie process, then the fault lies with the app itself, not with firejail. There might be a way to enhance firejail itself so that when it notices it has zombie children, it removes them - but that is not a behavior that can be achieved by altering sandbox parameters.
@Futureknows commented on GitHub (Feb 14, 2020):
The orphaned processes only persist when sandboxed. If I run VLC outside
firejail the process closes normally. It seems like it has to be an
interaction with the sandbox
On Fri, Feb 14, 2020 at 10:21 AM Jonathan Leivent notifications@github.com
wrote:
@jonleivent commented on GitHub (Feb 14, 2020):
That is probably because the linux init process already has the ability to deal with zombies that it directly inherits, which is what normally happens when zombies are created . But, if the zombie process is created in a firejail sandbox, then it never gets directly inherited by the linux init process. Not allowing processes to escape a sandbox is normally considered a major firejail feature, but in the case of zombies it is admittedly a nuisance.
I do think it is possible for firejail to handle zombies itself, but it would not be something achievable merely by altering the existing sandboxing parameters. It might require firejail to have some kind of daemon running that watches for the presence of zombie processes in sandboxes. But I'll leave that determination to the firejail developers.
@Futureknows commented on GitHub (Feb 22, 2020):
I see, thanks for the detailed explanation. I suppose the simplest workaround would be to force firejail to launch VLC in a new sandbox on each instance. Is this possible from firejail's command line?
@ghost commented on GitHub (Feb 23, 2020):
Not directly no. You can use a simple shell script wrapper to shutdown any lingering VLC sandbox prior to starting a new one. Here's a basic run-down:
name the VLC sandbox for easy killing (firejail --shutdown=vlc)
$ echo "name vlc" >> ${HOME}/.config/firejail/vlc.localcreate the wrapper script
Place
fj.vlc(or whatever you named it) somewhere it gets picked-up first by your PATH, e.g. ${HOME}/bin or /usr/local/bin. If you use a firecfg generated ${HOME}/.local/share/applications/vlc.desktop, make sure to edit theExec=line, now referencing thefj.vlccommand.@rusty-snake commented on GitHub (May 6, 2020):
Do we want to implement any zombie handling?
@Futureknows commented on GitHub (May 8, 2020):
FYI I have noticed it doesn't happen on all systems, so I don't think it's
a high priority.
On Wed, May 6, 2020 at 8:41 AM rusty-snake notifications@github.com wrote:
@rusty-snake commented on GitHub (Jan 4, 2021):
When I wrote the wps profiles, I noticed such a behaviour if seccomp was used. There where no violations in the syslog and it had even happen with
seccomp.drop @swap.@rusty-snake commented on GitHub (Aug 4, 2021):
I think we want. It shouldn't be complicated.