Skip to content

bug(sandbox): ioprio_set is denied for every target, so ionice on the caller's own process fails #5706

Open

Description

@EmilienM

User Story

I run OpenShell sandboxes with the Podman and Kubernetes drivers and I work on the sandbox isolation core. This came out of the review of #5212. I found it by reading the code and have not hit it in production.

Problem Statement

crates/openshell-sandbox/src/linux/child_seccomp.rs denies ioprio_set for every target. A workload cannot change its own I/O priority, so ionice -p $$ and ionice -c3 <command> fail with EPERM, although they work in a plain container. It is the same gap #5185 covers for sched_set*, prlimit64, and setpriority, and #5212 leaves it out of scope.

Impact / Why This Matters

Build and batch tooling that lowers its own I/O priority (ionice, psutil ionice()) fails only under OpenShell. The only workaround is to drop the call from the workload.

Acceptance Criteria

  • ioprio_set(IOPRIO_WHO_PROCESS, 0, ...) and the caller's own PID or sibling TIDs are allowed.
  • Other targets, IOPRIO_WHO_PGRP, and IOPRIO_WHO_USER stay denied with EPERM.
  • The syscall joins the mediated scheduling table from fix(sandbox): make mediated signal, scheduling, and limit calls behave natively #5212 (its selector is argument 0, like setpriority), so the notified set, the native pid 0 path, the broker dispatch, and the static deny stay derived from one place.
  • Unit and e2e tests cover the allowed and denied cases.

Reproduction Steps

Not run; from the code. Inside a sandbox, ionice -c3 -p $$ fails with Operation not permitted.

Environment

  • OpenShell: main at fea144c45
  • OS: Fedora 45, Linux 7.2.15
  • Deployment: Podman driver (local gateway)
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

    state:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions