mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[PR #6750] [MERGED] bugfix: fix potential deadlock with flock + SIGTSTP #6151
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#6151
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/6750
Author: @jlimor-kl
Created: 5/15/2025
Status: ✅ Merged
Merged: 5/21/2025
Merged by: @kmk3
Base:
master← Head:master📝 Commits (1)
2a5dc15bugfix: fix potential deadlock with flock + SIGTSTP📊 Changes
1 file changed (+49 additions, -0 deletions)
View changed files
📝
src/firejail/preproc.c(+49 -0)📄 Description
As reported by @hlein in #6729, if a firejailed process is
^Z'd at the wrong time during startup, other firejail processes will be unable to proceed because they'll wait forever for an flock on/run/firejail/firejail-run.lock.This fixes that by installing a signal handler to catch SIGTSTP (Ctrl-Z) before acquiring locks. The handler increments a flag to allow for re-sending the SIGTSTP signal after locks have been released.
Deadlock Reproducer
The length of the sleep should be adjusted until the debug output resembles below
Further calls to firejail will hang due to the stopped process holding the firejail-run lock.
After Patch
Due to locks being properly released before the process is stopped, new firejail processes will not hang while acquiring the lock.
Fixes #6729.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.