[GH-ISSUE #169] privileges scoped-spawn capability test fails when run as root; make test-unit has no fully green local environment #55

Closed
opened 2026-10-29 14:18:55 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @huajq on GitHub (Aug 13, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/169

Affected component: Build / installation

AgentENV version

  • Commit: f8f725e (main); Local modifications: none

Host environment

  • Ubuntu 24.04.2 LTS, kernel 6.8.0-60-generic, x86_64, cloud VM
  • Tests run as root with a full capability bounding set (CapBnd: 000001ffffffffff)

Operation and configuration

cargo test -p agentenv --lib privileges::tests::scoped_spawn_clears_child_capabilities_without_mutating_caller

Steps to reproduce

  1. Run the command above as root → fails.
  2. Run the same binary as non-root (setpriv --reuid=65534 ...) → passes.
  3. Run the full agentenv --lib suite as non-root → 151 other failures, so
    neither root nor non-root local runs are fully green.

Expected behavior

make test-unit passes in a clearly defined environment.

Actual behavior

assertion `left == right` failed: child retained CapPrm:
  left: "000001ffffffffff"  right: "0000000000000000"
# test result: FAILED. 700 passed; 1 failed (as root)

Reproduction frequency: Always (as root with a full bounding set)

Regression information

  • N/A — root-incompatible since introduction (8f028b1); not a regression.

Additional context

Cause: on execve, the kernel regrants an euid-0 child the full bounding
set (CapPrm/CapEff) unless SECBIT_NOROOT is set, so the "all sets zero"
expectation only holds for non-root runners (CI is non-root, hence green).

Suggested follow-ups:

  1. Make the test root-aware (skip, or assert only CapInh/CapAmb under
    root); document the expected make test-unit environment.
  2. Separately: under root deployments, scoped-spawn isolation silently does
    not hold (children regain the bounding set) — enforcing it needs
    SECBIT_NOROOT; a behavior change worth its own discussion.

Pre-submission checklist

  • Searched open and closed issues; no duplicate.
  • Minimal reproduction provided.
  • No credentials or sensitive information.
  • Not a security vulnerability.
Originally created by @huajq on GitHub (Aug 13, 2026). Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/169 **Affected component:** Build / installation **AgentENV version** - Commit: f8f725e (`main`); Local modifications: none **Host environment** - Ubuntu 24.04.2 LTS, kernel 6.8.0-60-generic, x86_64, cloud VM - Tests run as `root` with a full capability bounding set (`CapBnd: 000001ffffffffff`) **Operation and configuration** ```sh cargo test -p agentenv --lib privileges::tests::scoped_spawn_clears_child_capabilities_without_mutating_caller ``` **Steps to reproduce** 1. Run the command above as `root` → fails. 2. Run the same binary as non-root (`setpriv --reuid=65534 ...`) → passes. 3. Run the full `agentenv --lib` suite as non-root → 151 other failures, so neither root nor non-root local runs are fully green. **Expected behavior** `make test-unit` passes in a clearly defined environment. **Actual behavior** ```text assertion `left == right` failed: child retained CapPrm: left: "000001ffffffffff" right: "0000000000000000" # test result: FAILED. 700 passed; 1 failed (as root) ``` **Reproduction frequency:** Always (as root with a full bounding set) **Regression information** - N/A — root-incompatible since introduction (8f028b1); not a regression. **Additional context** Cause: on `execve`, the kernel regrants an euid-0 child the full bounding set (`CapPrm`/`CapEff`) unless `SECBIT_NOROOT` is set, so the "all sets zero" expectation only holds for non-root runners (CI is non-root, hence green). Suggested follow-ups: 1. Make the test root-aware (skip, or assert only `CapInh`/`CapAmb` under root); document the expected `make test-unit` environment. 2. Separately: under root deployments, scoped-spawn isolation silently does not hold (children regain the bounding set) — enforcing it needs `SECBIT_NOROOT`; a behavior change worth its own discussion. **Pre-submission checklist** - [x] Searched open and closed issues; no duplicate. - [x] Minimal reproduction provided. - [x] No credentials or sensitive information. - [x] Not a security vulnerability.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#55
No description provided.