diff --git a/fs/io_uring.c b/fs/io_uring.c index 07d6ef195d05a9607d1c067ad7cdee67292f943b..89aa8412b5f5972466e79c711cee475d8d42ebfe 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2245,6 +2245,10 @@ static int io_sq_offload_start(struct io_ring_ctx *ctx, goto err; if (ctx->flags & IORING_SETUP_SQPOLL) { + ret = -EPERM; + if (!capable(CAP_SYS_ADMIN)) + goto err; + if (p->flags & IORING_SETUP_SQ_AFF) { int cpu;