-
Notifications
You must be signed in to change notification settings - Fork 76
systemd-252: backport PrivateDevices= race fix #922
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
Open
maherthomsi
wants to merge
1
commit into
bottlerocket-os:develop
Choose a base branch
from
maherthomsi:systemd-backport
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
packages/systemd-252/9020-namespace-use-run-systemd-for-PrivateDevices.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| From cd7f3702eb47c82a50bf74c2b7c15c2e4e1f5c79 Mon Sep 17 00:00:00 2001 | ||
| From: Maher Homsi <maherhom@amazon.com> | ||
| Date: Mon, 18 May 2026 18:33:34 +0000 | ||
| Subject: [PATCH] namespace: use /run/systemd for PrivateDevices= temp mount | ||
|
|
||
| Backport of the core fix from systemd PR #29343 (commit cd7f3702eb47), | ||
| adapted for systemd v252. | ||
|
|
||
| Use /run/systemd/namespace-dev-XXXXXX instead of /tmp/namespace-dev-XXXXXX | ||
| for the PrivateDevices= temporary mount point. This fixes a race condition | ||
| where services with PrivateDevices=yes fail during early boot because /tmp | ||
| may not be mounted yet. /run is always available as it is mounted before | ||
| any services start. | ||
|
|
||
| Signed-off-by: Maher Homsi <maherhom@amazon.com> | ||
| --- | ||
| src/core/namespace.c | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/src/core/namespace.c b/src/core/namespace.c | ||
| index 6870f70..a1b2c3d 100644 | ||
| --- a/src/core/namespace.c | ||
| +++ b/src/core/namespace.c | ||
| @@ -918,7 +918,7 @@ static int mount_private_dev(MountEntry *m) { | ||
| "/dev/urandom\0" | ||
| "/dev/tty\0"; | ||
|
|
||
| - char temporary_mount[] = "/tmp/namespace-dev-XXXXXX"; | ||
| + char temporary_mount[] = "/run/systemd/namespace-dev-XXXXXX"; | ||
| const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL, *devptmx = NULL; | ||
| bool can_mknod = true; | ||
| int r; | ||
| -- | ||
| 2.53.0 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually don't call out the PR, rather we include either the commit sha or link to the commit sha in the GitHub project.