Registry Mirror
Skip to content

Conversation

@achoimet

Copy link
Copy Markdown
Member

Why

ociruntime decides once, when the package is initialized, whether CAP_SYS_PTRACE is in the effective set (var isCapSysPtraceSet = hasCap(unix.CAP_SYS_PTRACE)). Without it, every namespace lookup falls back to spawning a root readlink process and logs "CAP_SYS_PTRACE capability is not set. Using fallback with reduced performance."

extension-container and extension-host are moving their file capabilities from setcap …+eip to +ip, so that a missing capability no longer makes exec fail (the extension crash-loops today). Their capabilities then only become effective in main() (extruntime.RaiseCapabilities), after package initialization, and this check always sees them missing: every attack would take the slow path, with a false warning.

Seen in the E2E logs of steadybit/extension-container#525: the warning appears 7 times in the PR run vs once on main.

What

Evaluate the check on first use (sync.OnceValue), which happens when an attack runs, after main() has raised the capabilities. Nothing changes for binaries that keep the effective bit.

Related

@claude

claude Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Claude finished @joshiste's task in 12s —— View job


Review of PR #512

  • Resolve prior review threads (none from me)
  • Review the diff

No issues found. The change in go/action_kit_commons/ociruntime/utils_linux.go is correct and minimal.

  • isCapSysPtraceSet is only referenced in executeReadlinkInProc, and that call site is updated. Nothing else in go/ uses it.
  • sync.OnceValue is concurrency-safe, so parallel attacks can't race on the first check. The file already uses sync.OnceFunc, so the Go version requirement is already met.
  • Binaries that keep the effective bit behave as before.

One caveat, which isn't a blocker: the result is cached on first call. If anything calls into ociruntime before RaiseCapabilities runs in main(), a false result is cached for the life of the process. The PR description says the first call happens when an attack runs, so this should be fine.

…itialization

isCapSysPtraceSet was evaluated when the package was initialized, from the
effective capability set. Extensions whose binary carries its file
capabilities without the effective bit (setcap ...+ip) only make them
effective in main(), so the check always failed: every namespace lookup
took the slower fallback (a root readlink process) and logged a false
"CAP_SYS_PTRACE capability is not set" warning.
@joshiste
joshiste force-pushed the fix/lazy-sys-ptrace-check branch from d46a5b4 to 34abb81 Compare October 15, 2026 09:15
@sonarqubecloud

Copy link
Copy Markdown

joshiste pushed a commit to steadybit/extension-host that referenced this pull request Oct 15, 2026
joshiste pushed a commit to steadybit/extension-container that referenced this pull request Oct 15, 2026
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