]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4: fix up io_uring patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Jan 2020 13:20:34 +0000 (14:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Jan 2020 13:20:34 +0000 (14:20 +0100)
queue-5.4/io_uring-only-allow-submit-from-owning-task.patch

index bbcc47b4ce387fe68fe02391a0559685680435a6..54e688d4720389c43d710a7a50ce464b9f352677 100644 (file)
@@ -18,16 +18,17 @@ Suggested-by: Stefan Metzmacher <metze@samba.org>
 Signed-off-by: Jens Axboe <axboe@kernel.dk>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
+
 ---
  fs/io_uring.c |    6 ++++++
  1 file changed, 6 insertions(+)
 
 --- a/fs/io_uring.c
 +++ b/fs/io_uring.c
-@@ -2798,6 +2798,12 @@ static int io_sq_thread(void *data)
-                       }
-               }
+@@ -3716,6 +3716,12 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned
+                       wake_up(&ctx->sqo_wait);
+               submitted = to_submit;
+       } else if (to_submit) {
 +              if (current->mm != ctx->sqo_mm ||
 +                  current_cred() != ctx->creds) {
 +                      ret = -EPERM;
@@ -35,5 +36,5 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +              }
 +
                to_submit = min(to_submit, ctx->sq_entries);
-               inflight += io_submit_sqes(ctx, to_submit, cur_mm != NULL,
-                                          mm_fault);
+               mutex_lock(&ctx->uring_lock);