mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[PR #6307] [MERGED] bugfix: fix startup race condition for /run/firejail directory #5946
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#5946
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?
📋 Pull Request Information
Original PR: https://github.com/netblue30/firejail/pull/6307
Author: @spiiroin
Created: 4/12/2024
Status: ✅ Merged
Merged: 4/25/2024
Merged by: @kmk3
Base:
master← Head:serialize_remounts📝 Commits (3)
773073crefactor: make rundir lock variables global53bc658modif: improve flock handlinge53b6d6modif: populate /run/firejail while holding flock📊 Changes
4 files changed (+118 additions, -36 deletions)
View changed files
📝
src/firejail/chroot.c(+4 -1)📝
src/firejail/firejail.h(+8 -1)📝
src/firejail/main.c(+11 -33)📝
src/firejail/preproc.c(+95 -1)📄 Description
There are reports of firejail sandboxed applications occasionally taking long time (12 seconds) to start up. When this happens, it affects all sandboxed applications until the device is rebooted.
The reason for the slowdown seems to be a timing hazard in the way remounts under /run/firejail are handled. This gets triggered when multiple firejail processes are launched in parallel as part of user session bring up and results in some, dozens, hundreds, or even thousands of stray /run/firejail/xxx mounts. The amount of mount points then affects every mount operation that is done during sandbox filesystem construction.
To stop this from happening, arrange it so that only one firejail process at time is inspecting and/or modifying mountpoints under /run/firejail by doing:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.