diff --git a/fs/io_uring.c b/fs/io_uring.c index b73bbd5db3843712a1ae28a33ebe890a9c3b955c..411372a2bb6e1d4aaea163f1fb5725a4f3b1b380 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2242,6 +2242,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;