Skip to content

fix(sandbox): block keyctl family in workload seccomp filters - #5991

Open
ytfh44 wants to merge 1 commit into
ai-openshell:mainfrom
ytfh44:fix/5989-seccomp-keyctl-filter/ytfh44
Open

ytfh44 wants to merge 1 commit into
ai-openshell:mainfrom
ytfh44:fix/5989-seccomp-keyctl-filter/ytfh44

Conversation

@ytfh44

@ytfh44 ytfh44 commented Nov 26, 2026

Copy link
Copy Markdown

Summary

The Linux workload seccomp filters allowed the kernel keyring syscall family (keyctl, add_key, request_key) through the default-allow path. This change blocks all three unconditionally in both the main workload filter and the spawned-child filter.

Related Issue

Closes #5989

Changes

  • crates/openshell-sandbox/src/sandbox/linux/seccomp.rs: add SYS_keyctl, SYS_add_key, SYS_request_key to the unconditional block list in build_filter_rules, and extend unconditional_blocks_present_in_filter to pin them
  • crates/openshell-sandbox/src/linux/child_seccomp.rs: add the same three syscalls to the spawned-child unconditional deny array

Kernel keyrings are shared with the boundary process at the same UID, and request_key(2) can invoke the root-owned /sbin/request-key upcall outside the sandbox's logging and mediation.

Release Notes

Sandboxed workloads can no longer invoke the Linux kernel keyring syscalls (keyctl, add_key, request_key); they now fail with EPERM like other blocked syscall families.

Testing

  • Checks appropriate to the affected code and behavior pass — rustfmt --check clean; cargo +1.98.1 check -p openshell-sandbox passes on Windows (Linux-gated modules are cfg'd out locally; CI covers the Linux build)
  • Unit tests added/updated — unconditional_blocks_present_in_filter now asserts the three new unconditional blocks
  • E2E tests added/updated (if applicable) — not applicable; syscall-level policy covered by unit contract test

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

- Add SYS_keyctl, SYS_add_key and SYS_request_key as unconditional EPERM entries in both the main workload filter (sandbox/linux/seccomp.rs) and the spawned-child filter (linux/child_seccomp.rs).
- Kernel keyrings are shared with the boundary process at the same UID, and request_key(2) can invoke the root-owned /sbin/request-key upcall outside the sandbox's logging and mediation.
- Extend unconditional_blocks_present_in_filter to pin the new blocks.

Signed-off-by: ytfh44 <82327657+ytfh44@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

seccomp: keyctl family syscalls are not blocked in workload filters

1 participant