Skip to content

config-linux: add linux.ioUring - #1328

Open
gvozdetsky wants to merge 1 commit into
opencontainers:mainfrom
gvozdetsky:io-uring-restrictions
Open

gvozdetsky wants to merge 1 commit into
opencontainers:mainfrom
gvozdetsky:io-uring-restrictions

Conversation

@gvozdetsky

Copy link
Copy Markdown

Adds linux.ioUring, an allowlist of io_uring operations for the container, based on the task restrictions added in Linux 7.0. Closes #1323.

Compared to the issue, defaultAction and deniedSqeFlags are dropped and register opcodes are out of scope. All of them can be added later without breaking existing configs.

Implementation: youki-dev/youki#3805 (draft, uses an annotation until this is merged).

On 7.0 and 7.1 without bc0e8faf90e7, restrictions are lost on exec. The spec doesn't mention kernel versions, so detecting this is left to runtimes.

gvozdetsky added a commit to gvozdetsky/youki that referenced this pull request Oct 13, 2026
The proposed linux.ioUring says that whether an operation is allowed
doesn't depend on its submission flags (opencontainers/runtime-spec#1328).
Check it: a read with IOSQE_BUFFER_SELECT must be allowed. No buffers
are registered, so the kernel answers -ENOBUFS, not -EACCES. A runtime
that builds the allowlist with IORING_REGISTER_RESTRICTIONS would deny
it, since that also denies every flag that isn't listed.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Eugene Gvozdetsky <gvozdet@gmail.com>
@AkihiroSuda
AkihiroSuda requested a balanced review from Copilot October 13, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Go serialization currently converts an empty socket-family allowlist into an omitted, unrestricted policy.

1 open finding
What changed in this PR

Adds OCI configuration and feature reporting for Linux io_uring operation allowlists.

Changes:

  • Defines linux.ioUring and corresponding Go types.
  • Adds schemas, validation fixtures, and feature reporting.
  • Documents enforcement semantics and examples.
File Description
specs-go/​features/​features.go Adds io_uring feature reporting types.
specs-go/​config.go Adds io_uring configuration types.
schema/​test/​config/​good/​linux-io-uring.json Adds valid configuration fixture.
schema/​test/​config/​bad/​linux-io-uring.json Tests required ops.
schema/​test/​config/​bad/​linux-io-uring-invalid-op.json Tests operation-name validation.
schema/​features-linux.json Defines feature schema.
schema/​defs-linux.json Defines operation and family patterns.
schema/​config-linux.json Defines configuration schema.
features.md Extends the complete feature example.
features-linux.md Documents feature reporting.
config-linux.md Documents io_uring restrictions.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread specs-go/config.go
gvozdetsky added a commit to gvozdetsky/youki that referenced this pull request Oct 13, 2026
The proposed linux.ioUring no longer allows an empty socketFamilies
(opencontainers/runtime-spec#1328). To deny all sockets, leave
IORING_OP_SOCKET out of ops.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Eugene Gvozdetsky <gvozdet@gmail.com>
Restrict the io_uring operations a container can submit, using the
io_uring task restrictions added in Linux 7.0. io_uring operations are
not system calls, so seccomp cannot filter them.

ops is an allowlist that doesn't depend on submission flags, so runtimes
behave the same whether they use BPF filters or the task allowlist. An
empty socketFamilies is not allowed: Go's omitempty would turn it into
"any family". To deny all sockets, leave IORING_OP_SOCKET out of ops.

Closes opencontainers#1323.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Eugene Gvozdetsky <gvozdet@gmail.com>
@gvozdetsky
gvozdetsky force-pushed the io-uring-restrictions branch from cacd22a to 8c70401 Compare October 13, 2026 14:25
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.

Proposal: linux.ioUring to restrict io_uring operations (Linux 7.0+)

2 participants