Skip to content

RFC Per-task io_uring opcode restrictions

Jens Axboe io-uring 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest3 patches 2 repliesIn review
  2. v1 RFC2 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Remove IORING_REG_RESTRICTIONS_INHERIT flag, restrictions are inherited across fork by default now.
- Allow original creator of a restriction set to unregister it as well.
- Add IORING_REG_RESTRICTIONS_MASK flag, which allows anyone to further restrict the currently assigned restriction set.
- Ensure failure operations restore old set.
- Add more test cases on the liburing side.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3io_uring: allow registration of per-task restrictionsinclude/linux/io_uring.h include/linux/io_uring_types.h include/linux/sched.h +5 more+79 -100 replies
2/3io_uring/register: add MASK support for task filter setinclude/uapi/linux/io_uring.h io_uring/register.c+49 -140 replies
3/3io_uring/register: allow original task restrictions owner to unregisterinclude/linux/io_uring_types.h io_uring/register.c+38 -82 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCHSET RFC v2 0/3] Per-task io_uring opcode restrictions

Hi,

For details on this patchset, see the v1 posting here:

https://lore.kernel.org/io-uring/[email protected]/

This code can also be found here:

https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git/log/?h=io_uring-task-restrictions

and a corresponding liburing branch here:

https://git.kernel.org/pub/scm/linux/kernel/git/axboe/liburing.git/log/?h=task-restrictions

with basic support and test cases.

 include/linux/io_uring.h       |   2 +-
 include/linux/io_uring_types.h |   2 +
 include/linux/sched.h          |   1 +
 include/uapi/linux/io_uring.h  |  18 ++++++
 io_uring/io_uring.c            |  10 +++
 io_uring/register.c            | 110 ++++++++++++++++++++++++++++++---
 io_uring/tctx.c                |  25 +++++---
 kernel/fork.c                  |   4 ++
 8 files changed, 153 insertions(+), 19 deletions(-)

Changes since v1
- Remove IORING_REG_RESTRICTIONS_INHERIT flag, restrictions are inherited across fork by default now.
- Allow original creator of a restriction set to unregister it as well.
- Add IORING_REG_RESTRICTIONS_MASK flag, which allows anyone to further restrict the currently assigned restriction set.
- Ensure failure operations restore old set.
- Add more test cases on the liburing side.

Signature · 1 line
Jens Axboe