]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2025 06:40:17 +0000 (08:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2025 06:40:17 +0000 (08:40 +0200)
added patches:
io_uring-don-t-post-tag-cqes-on-file-buffer-registration-failure.patch

queue-6.14/io_uring-don-t-post-tag-cqes-on-file-buffer-registration-failure.patch [new file with mode: 0644]
queue-6.14/series

diff --git a/queue-6.14/io_uring-don-t-post-tag-cqes-on-file-buffer-registration-failure.patch b/queue-6.14/io_uring-don-t-post-tag-cqes-on-file-buffer-registration-failure.patch
new file mode 100644 (file)
index 0000000..6407703
--- /dev/null
@@ -0,0 +1,66 @@
+From dd48da6de203d67a3f9db2c6b5ec5dac0702ae25 Mon Sep 17 00:00:00 2001
+From: Pavel Begunkov <asml.silence@gmail.com>
+Date: Fri, 4 Apr 2025 15:46:34 +0100
+Subject: io_uring: don't post tag CQEs on file/buffer registration failure
+
+From: Pavel Begunkov <asml.silence@gmail.com>
+
+Commit ab6005f3912fff07330297aba08922d2456dcede upstream.
+
+Buffer / file table registration is all or nothing, if it fails all
+resources we might have partially registered are dropped and the table
+is killed. If that happens, it doesn't make sense to post any rsrc tag
+CQEs. That would be confusing to the application, which should not need
+to handle that case.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
+Fixes: 7029acd8a9503 ("io_uring/rsrc: get rid of per-ring io_rsrc_node list")
+Link: https://lore.kernel.org/r/c514446a8dcb0197cddd5d4ba8f6511da081cf1f.1743777957.git.asml.silence@gmail.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ io_uring/rsrc.c |   17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+--- a/io_uring/rsrc.c
++++ b/io_uring/rsrc.c
+@@ -130,6 +130,18 @@ struct io_rsrc_node *io_rsrc_node_alloc(
+       return node;
+ }
++static void io_clear_table_tags(struct io_rsrc_data *data)
++{
++      int i;
++
++      for (i = 0; i < data->nr; i++) {
++              struct io_rsrc_node *node = data->nodes[i];
++
++              if (node)
++                      node->tag = 0;
++      }
++}
++
+ __cold void io_rsrc_data_free(struct io_ring_ctx *ctx, struct io_rsrc_data *data)
+ {
+       if (!data->nr)
+@@ -539,6 +551,7 @@ int io_sqe_files_register(struct io_ring
+       io_file_table_set_alloc_range(ctx, 0, ctx->file_table.data.nr);
+       return 0;
+ fail:
++      io_clear_table_tags(&ctx->file_table.data);
+       io_sqe_files_unregister(ctx);
+       return ret;
+ }
+@@ -855,8 +868,10 @@ int io_sqe_buffers_register(struct io_ri
+       }
+       ctx->buf_table = data;
+-      if (ret)
++      if (ret) {
++              io_clear_table_tags(&ctx->buf_table);
+               io_sqe_buffers_unregister(ctx);
++      }
+       return ret;
+ }
index 1b270dc525d588d6a050e09610cadb68eb9b712d..f8486ec01d035c69f4df18a53026e8e3e3924130 100644 (file)
@@ -217,3 +217,4 @@ drm-i915-dp-check-for-has_dsc_3engines-while-configuring-dsc-slices.patch
 drm-amd-display-dml2-use-vzalloc-rather-than-kzalloc.patch
 drm-amdgpu-fix-warning-of-drm_mm_clean.patch
 drm-mgag200-fix-value-in-vblkstr-register.patch
+io_uring-don-t-post-tag-cqes-on-file-buffer-registration-failure.patch