]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Mar 2023 14:02:39 +0000 (15:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Mar 2023 14:02:39 +0000 (15:02 +0100)
added patches:
io_uring-ensure-that-io_init_req-passes-in-the-right.patch
series

queue-5.15/io_uring-ensure-that-io_init_req-passes-in-the-right.patch [new file with mode: 0644]
queue-5.15/series [new file with mode: 0644]

diff --git a/queue-5.15/io_uring-ensure-that-io_init_req-passes-in-the-right.patch b/queue-5.15/io_uring-ensure-that-io_init_req-passes-in-the-right.patch
new file mode 100644 (file)
index 0000000..b5e4d62
--- /dev/null
@@ -0,0 +1,30 @@
+From 8faad4b8f64aa27a54a5fbbe5c3163cc3b7dd61c Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Fri, 3 Mar 2023 06:49:57 -0700
+Subject: io_uring: ensure that io_init_req() passes in the right issue_flags
+
+From: Jens Axboe <axboe@kernel.dk>
+
+We can't use 0 here, as io_init_req() is always invoked with the
+ctx uring_lock held. Newer kernels have IO_URING_F_UNLOCKED for this,
+but previously we used IO_URING_F_NONBLOCK to indicate this as well.
+
+Fixes: cf7f9cd50013 ("io_uring: add missing lock in io_get_file_fixed")
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ io_uring/io_uring.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/io_uring/io_uring.c
++++ b/io_uring/io_uring.c
+@@ -7310,7 +7310,8 @@ static int io_init_req(struct io_ring_ct
+       if (io_op_defs[req->opcode].needs_file) {
+               req->file = io_file_get(ctx, req, READ_ONCE(sqe->fd),
+-                                      (sqe_flags & IOSQE_FIXED_FILE), 0);
++                                      (sqe_flags & IOSQE_FIXED_FILE),
++                                      IO_URING_F_NONBLOCK);
+               if (unlikely(!req->file))
+                       ret = -EBADF;
+       }
diff --git a/queue-5.15/series b/queue-5.15/series
new file mode 100644 (file)
index 0000000..48fad70
--- /dev/null
@@ -0,0 +1 @@
+io_uring-ensure-that-io_init_req-passes-in-the-right.patch