Skip to content

[macos] run: invalid --cpuset-cpus 3-1 is accepted (fail-open) #267

Closed

Description

@CharlieZiChen

Summary

On macOS HVF (a3s-box v3.2.5 / 2d5d7cb61c968d7f3dd852f42f48530066c3c03a), a3s-box run --cpuset-cpus 3-1 … succeeds (exit 0). The inverted range is stored on the box record instead of being rejected before workload start.

Severity: P2 (invalid resource limit fail-open)

Acceptance case: release negative_matrix / bad-cpuset

Local tracking: BUG-0009

Upstream shim unit tests already treat parse_cpuset_spec("3-1") as an error, but the CLI/microvm admission path does not reject it.

Expected

Invalid cpuset specs (e.g. inverted range 3-1) are rejected with a non-zero exit before creating/starting a VM, with an error mentioning cpu/invalid/range, and no leftover box resources.

Actual

a3s-box run --rm --cpuset-cpus 3-1 alpine:3.20 -- true
# → exit 0 (workload runs)

a3s-box run -d --name c --cpuset-cpus 3-1 alpine:3.20 -- sleep 30
a3s-box inspect c
# resource_limits.cpuset_cpus == "3-1"

Repro

export A3S_HOME="$(mktemp -d /private/var/tmp/a3s-bug0009.XXXXXX)"
a3s-box --version
a3s-box info

a3s-box run --rm --cpuset-cpus 3-1 docker.io/library/alpine:3.20 -- true
echo "exit=$?"
# expect today: 0
# expect desired: non-zero rejection

a3s-box run -d --name cpuset-bad --cpuset-cpus 3-1 docker.io/library/alpine:3.20 -- sleep 30
a3s-box inspect cpuset-bad   # shows cpuset_cpus: "3-1"
a3s-box rm -f cpuset-bad

Repro rate: (2026-09-08 isolated).

Environment

Item Value
OS macOS 15 arm64
Backend HVF / microvm
Binary v3.2.5 release macos-arm64
Commit 2d5d7cb61c968d7f3dd852f42f48530066c3c03a

Notes

Sandbox OCI validate_cpuset appears to only check character set (digits/,/-), not range order. macOS microvm path does not apply the stricter shim parser at CLI admission → fail-open.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions