Skip to content

test: check that per-task restrictions survive exec - #1652

Merged
axboe merged 1 commit into
axboe:masterfrom
gvozdetsky:task-restrict-exec
Oct 9, 2026
Merged

axboe merged 1 commit into
axboe:masterfrom
gvozdetsky:task-restrict-exec

Conversation

@gvozdetsky

Copy link
Copy Markdown
Contributor

Per-task io_uring restrictions must keep applying to rings created after exec, including when the task used io_uring before the exec.

Kernels without bc0e8faf90e7 ("io_uring: preserve task restrictions across exec", CVE-2026-80713) drop the restrictions in that case. The new image can then create unrestricted rings. task-restrict.t doesn't exec, so it passes on those kernels.

The new task-restrict-exec.t:

  1. restricts a child to NOP;
  2. optionally uses a ring;
  3. re-execs itself;
  4. checks in the new image that a fresh ring still denies a read.

It covers both the opcode allowlist and a BPF filter, with and without using a ring before the exec. The re-exec'd image is told apart by an environment variable, because the test runner passes arguments.

Results (virtme-ng):

Kernel task-restrict-exec.t task-restrict.t
6.18 skip skip
7.0 fail (read after exec: 0 (expected -EACCES)) pass
7.2.9 pass pass

Context: I'm adding task-restriction support to a container runtime (opencontainers/runtime-spec#1323, notes in https://github.com/gvozdetsky/iouring-lab).

Per-task io_uring restrictions must keep applying to rings created after
exec, also when the task used io_uring before exec. Kernels without
commit bc0e8faf90e7 ("io_uring: preserve task restrictions across exec")
free the restrictions with the task context on exec in that case, so the
new image can create unrestricted rings. task-restrict.t doesn't cover
exec, so it passes on those kernels.

Restrict a child to NOP, optionally use a ring, re-exec the test and
check that a fresh ring still denies a read. Cover both the opcode
allowlist and a BPF filter.

Skips on 6.18, fails on 7.0, passes on 7.2.9.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Eugene Gvozdetsky <gvozdet@gmail.com>
@axboe
axboe merged commit d5b6007 into axboe:master Oct 9, 2026
20 checks passed
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.

2 participants