]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - fs/io_uring.c
kprobes: Mark ftrace mcount handler functions nokprobe
[thirdparty/kernel/linux.git] / fs / io_uring.c
index bbdbd56cf2ac9384b83e78945b2c6c0031cc346d..89aa8412b5f5972466e79c711cee475d8d42ebfe 100644 (file)
@@ -2215,6 +2215,7 @@ static int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg,
                        fput(ctx->user_files[i]);
 
                kfree(ctx->user_files);
+               ctx->user_files = NULL;
                ctx->nr_user_files = 0;
                return ret;
        }
@@ -2244,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;