Skip to content

cli: Gate IPC namespace entrance on CAP_SYS_ADMIN#2117

Open
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
cgwalters:fix-pid1-ns-v2
Open

cli: Gate IPC namespace entrance on CAP_SYS_ADMIN#2117
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
cgwalters:fix-pid1-ns-v2

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

Extract the IPC namespace joining logic into a join_host_ipc_namespace() helper that checks for CAP_SYS_ADMIN first, since setns() requires it. Without the capability we skip the operation entirely.

Fixes: #2090
Assisted-by: OpenCode (Claude Opus 4)

@cgwalters
Copy link
Copy Markdown
Collaborator Author

In theory we could try to move some other things we do at install time here...or...perhaps safer, consolidate this with a single "re-exec self" dance. I kind of lean to the latter, it has a lower blast radius. But I think this change will work fine for now.

@cgwalters cgwalters enabled auto-merge (rebase) April 2, 2026 13:24
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the IPC namespace joining logic into a dedicated function and introduces a CAP_SYS_ADMIN capability check to allow unprivileged execution of basic CLI commands. A regression test was added to ensure bootc --help works for non-root users. Feedback was provided to include logging when the IPC namespace join is skipped to improve observability.

@cgwalters cgwalters force-pushed the fix-pid1-ns-v2 branch 2 times, most recently from 0bc4bc0 to 19d990f Compare April 2, 2026 13:57
Extract the IPC namespace joining logic into a join_host_ipc_namespace()
helper that checks the effective capability set for CAP_SYS_ADMIN first,
since setns() requires it. Without the capability we skip the operation
entirely.

Fixes: bootc-dev#2090
Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant