]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 10:48:26 +0000 (12:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 10:48:26 +0000 (12:48 +0200)
added patches:
io_uring-add-missing-item-types-for-various-requests.patch

queue-5.10/io_uring-add-missing-item-types-for-various-requests.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/io_uring-add-missing-item-types-for-various-requests.patch b/queue-5.10/io_uring-add-missing-item-types-for-various-requests.patch
new file mode 100644 (file)
index 0000000..6518bda
--- /dev/null
@@ -0,0 +1,107 @@
+From 803feb0668f7cfda70a0e49bb7b070502a8dddc3 Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Wed, 22 Jun 2022 14:05:49 -0600
+Subject: io_uring: add missing item types for various requests
+
+From: Jens Axboe <axboe@kernel.dk>
+
+Any read/write should grab current->nsproxy, denoted by IO_WQ_WORK_FILES
+as it refers to current->files as well, and connect and recv/recvmsg,
+send/sendmsg should grab current->fs which is denoted by IO_WQ_WORK_FS.
+
+No upstream commit exists for this issue.
+
+Reported-by: Bing-Jhong Billy Jheng <billy@starlabs.sg>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/io_uring.c |   23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
+--- a/fs/io_uring.c
++++ b/fs/io_uring.c
+@@ -773,7 +773,8 @@ static const struct io_op_def io_op_defs
+               .buffer_select          = 1,
+               .needs_async_data       = 1,
+               .async_size             = sizeof(struct io_async_rw),
+-              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
++              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
++                                        IO_WQ_WORK_FILES,
+       },
+       [IORING_OP_WRITEV] = {
+               .needs_file             = 1,
+@@ -783,7 +784,7 @@ static const struct io_op_def io_op_defs
+               .needs_async_data       = 1,
+               .async_size             = sizeof(struct io_async_rw),
+               .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
+-                                              IO_WQ_WORK_FSIZE,
++                                        IO_WQ_WORK_FSIZE | IO_WQ_WORK_FILES,
+       },
+       [IORING_OP_FSYNC] = {
+               .needs_file             = 1,
+@@ -794,7 +795,8 @@ static const struct io_op_def io_op_defs
+               .unbound_nonreg_file    = 1,
+               .pollin                 = 1,
+               .async_size             = sizeof(struct io_async_rw),
+-              .work_flags             = IO_WQ_WORK_BLKCG | IO_WQ_WORK_MM,
++              .work_flags             = IO_WQ_WORK_BLKCG | IO_WQ_WORK_MM |
++                                        IO_WQ_WORK_FILES,
+       },
+       [IORING_OP_WRITE_FIXED] = {
+               .needs_file             = 1,
+@@ -803,7 +805,7 @@ static const struct io_op_def io_op_defs
+               .pollout                = 1,
+               .async_size             = sizeof(struct io_async_rw),
+               .work_flags             = IO_WQ_WORK_BLKCG | IO_WQ_WORK_FSIZE |
+-                                              IO_WQ_WORK_MM,
++                                        IO_WQ_WORK_MM | IO_WQ_WORK_FILES,
+       },
+       [IORING_OP_POLL_ADD] = {
+               .needs_file             = 1,
+@@ -857,7 +859,7 @@ static const struct io_op_def io_op_defs
+               .pollout                = 1,
+               .needs_async_data       = 1,
+               .async_size             = sizeof(struct io_async_connect),
+-              .work_flags             = IO_WQ_WORK_MM,
++              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_FS,
+       },
+       [IORING_OP_FALLOCATE] = {
+               .needs_file             = 1,
+@@ -885,7 +887,8 @@ static const struct io_op_def io_op_defs
+               .pollin                 = 1,
+               .buffer_select          = 1,
+               .async_size             = sizeof(struct io_async_rw),
+-              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
++              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
++                                        IO_WQ_WORK_FILES,
+       },
+       [IORING_OP_WRITE] = {
+               .needs_file             = 1,
+@@ -894,7 +897,7 @@ static const struct io_op_def io_op_defs
+               .pollout                = 1,
+               .async_size             = sizeof(struct io_async_rw),
+               .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
+-                                              IO_WQ_WORK_FSIZE,
++                                        IO_WQ_WORK_FSIZE | IO_WQ_WORK_FILES,
+       },
+       [IORING_OP_FADVISE] = {
+               .needs_file             = 1,
+@@ -907,14 +910,16 @@ static const struct io_op_def io_op_defs
+               .needs_file             = 1,
+               .unbound_nonreg_file    = 1,
+               .pollout                = 1,
+-              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
++              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
++                                        IO_WQ_WORK_FS,
+       },
+       [IORING_OP_RECV] = {
+               .needs_file             = 1,
+               .unbound_nonreg_file    = 1,
+               .pollin                 = 1,
+               .buffer_select          = 1,
+-              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
++              .work_flags             = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
++                                        IO_WQ_WORK_FS,
+       },
+       [IORING_OP_OPENAT2] = {
+               .work_flags             = IO_WQ_WORK_FILES | IO_WQ_WORK_FS |
index ebcfdb33045434c83d0edba7117de958e8c4dd57..9cf44d8527c7e4123d1e181ed96281b01d89e223 100644 (file)
@@ -9,3 +9,4 @@ tcp-increase-source-port-perturb-table-to-2-16.patch
 tcp-drop-the-hash_32-part-from-the-index-calculation.patch
 serial-core-initialize-rs485-rts-polarity-already-on-probe.patch
 arm64-mm-don-t-invalidate-from_device-buffers-at-start-of-dma-transfer.patch
+io_uring-add-missing-item-types-for-various-requests.patch