Skip to content

bug: some calls fail or are interrupted inside the sandbox but work natively (rt_sigqueueinfo, self-directed kill, sched_setaffinity, prlimit64, nice) #5185

Open

Description

@EmilienM

User Story

I run OpenShell sandboxes with the Podman and Kubernetes drivers, and I read through the isolation core (openshell-sandbox, openshell-binary-identity, openshell-isolation-interface) at 00528d24a. This item comes from reading the code. I have not hit it in production. It is one line of the umbrella issue #5179.

Problem Statement

Three compatibility gaps in the mediated signal and scheduling calls:

  • crates/openshell-sandbox/src/linux/process_signal.rs:60: the rt_sigqueueinfo emulation passes the workload's siginfo to pidfd_send_signal unchanged. The native syscall overwrites si_signo with the signal number; pidfd_send_signal instead requires si_signo to match and returns EINVAL otherwise. A program that leaves si_signo unset fails only under OpenShell.
  • process_signal.rs:73: a self-directed kill()/rt_sigqueueinfo() is emulated by sending through a pidfd while the caller is still blocked in its seccomp notification, so the signal interrupts the very syscall being emulated. Without SA_RESTART the call can return EINTR/InterruptedError; with SA_RESTART it can restart and be notified again.
  • crates/openshell-sandbox/src/linux/child_seccomp.rs:232: sched_setaffinity, sched_setattr, sched_setscheduler, sched_setparam and prlimit64 are denied for any nonzero PID argument. glibc pthread_setaffinity_np and pthread_setschedparam pass the kernel TID, so thread pinning (OpenMP GOMP_CPU_AFFINITY, taskset -p $$, psutil cpu_affinity(pid)) and prlimit(getpid()) fail with EPERM. setpriority is denied outright, so nice fails even for the caller's own priority.

Impact / Why This Matters

Common ML, build and test tooling behaves differently inside OpenShell than outside: CPU pinning and priority changes fail, and signalling oneself can raise EINTR. The failures are surprising because the same code works in a plain container.

Acceptance Criteria

  • rt_sigqueueinfo emulation sets si_signo to the requested signal before pidfd_send_signal.
  • Self-directed signals complete without interrupting the call being emulated (deliver after the response or use a path that does not wake the waiter).
  • The nonzero-PID deny allows the caller's own TGID and its own threads (and setpriority on self) and still blocks other targets.
  • Tests cover os.kill(os.getpid(), SIGUSR1), sched_setaffinity(0, ...) on a thread, and nice.

Reproduction Steps

Found by reading the code; not reproduced live. Inside a sandbox: python3 -c 'import os, signal; signal.signal(signal.SIGUSR1, lambda *a: None); os.kill(os.getpid(), signal.SIGUSR1)', taskset -p $$, and nice -n 1 true. Expect them to behave as on the host. Not run yet.

Environment

  • OpenShell: main at 00528d24a
  • OS: Fedora 44, Linux 7.2.14
  • Deployment: Podman driver (local gateway); code read for the Kubernetes driver too

Activity

  1. added
    state:acceptedA maintainer decided OpenShell should pursue this issue
    on Nov 3, 2026
  2. mrunalp commented on Nov 3, 2026

    @mrunalp
    Collaborator

    Accepted for implementation in #5212.

    Source inspection at 32dcc4a67: Signal mediation forwards the copied siginfo to pidfd_send_signal and responds after sending; the child filter rejects nonzero scheduling/resource-limit targets. The compatibility report merits the proposed fixes, with regression coverage for native self/thread behavior and continued denial of other targets.

    This assessment is based on the source and the linked report/PR; I have not independently run deployment reproductions or the PR test suite. CI and code review still need to validate the fix.

  3. added
    area:runtimeSandbox execution, isolation, supervision, policy enforcement, networking, and provider lifecycle.
    topic:securityVulnerability management, security analysis/auditing, bypass detection, and abuse prevention.
    topic:testingUnit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.
    meta:labeler-checkpointTemporary label used by /label-issue to record a verified classification checkpoint.
    and removed
    topic:testingUnit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.
    meta:labeler-checkpointTemporary label used by /label-issue to record a verified classification checkpoint.
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runtimeSandbox execution, isolation, supervision, policy enforcement, networking, and provider lifecycle.state:acceptedA maintainer decided OpenShell should pursue this issuetopic:securityVulnerability management, security analysis/auditing, bypass detection, and abuse prevention.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions