]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop queue-5.5/io_uring-fix-double-prep-iovec-leak.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2020 14:07:13 +0000 (15:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2020 14:07:13 +0000 (15:07 +0100)
queue-5.5/io_uring-fix-double-prep-iovec-leak.patch [deleted file]
queue-5.5/io_uring-retry-raw-bdev-writes-if-we-hit-eopnotsupp.patch
queue-5.5/series

diff --git a/queue-5.5/io_uring-fix-double-prep-iovec-leak.patch b/queue-5.5/io_uring-fix-double-prep-iovec-leak.patch
deleted file mode 100644 (file)
index f596d2d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-From 5f798beaf35d79355cbf18019c1993a84475a2c3 Mon Sep 17 00:00:00 2001
-From: Pavel Begunkov <asml.silence@gmail.com>
-Date: Sat, 8 Feb 2020 13:28:02 +0300
-Subject: io_uring: fix double prep iovec leak
-
-From: Pavel Begunkov <asml.silence@gmail.com>
-
-commit 5f798beaf35d79355cbf18019c1993a84475a2c3 upstream.
-
-Requests may be prepared multiple times with ->io allocated (i.e. async
-prepared). Preparation functions don't handle it and forget about
-previously allocated resources. This may happen in case of:
-- spurious defer_check
-- non-head (i.e. async prepared) request executed in sync (via nxt).
-
-Make the handlers check, whether they already allocated resources, which
-is true IFF REQ_F_NEED_CLEANUP is set.
-
-Cc: stable@vger.kernel.org # 5.5
-Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- fs/io_uring.c |   12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
---- a/fs/io_uring.c
-+++ b/fs/io_uring.c
-@@ -1816,7 +1816,8 @@ static int io_read_prep(struct io_kiocb
-       if (unlikely(!(req->file->f_mode & FMODE_READ)))
-               return -EBADF;
--      if (!req->io)
-+      /* either don't need iovec imported or already have it */
-+      if (!req->io || req->flags & REQ_F_NEED_CLEANUP)
-               return 0;
-       io = req->io;
-@@ -1903,7 +1904,8 @@ static int io_write_prep(struct io_kiocb
-       if (unlikely(!(req->file->f_mode & FMODE_WRITE)))
-               return -EBADF;
--      if (!req->io)
-+      /* either don't need iovec imported or already have it */
-+      if (!req->io || req->flags & REQ_F_NEED_CLEANUP)
-               return 0;
-       io = req->io;
-@@ -2649,6 +2651,9 @@ static int io_poll_wake(struct wait_queu
-       /* for instances that support it check for an event match first: */
-       if (mask && !(mask & poll->events))
-               return 0;
-+      /* iovec is already imported */
-+      if (req->flags & REQ_F_NEED_CLEANUP)
-+              return 0;
-       list_del_init(&poll->wait.entry);
-@@ -3151,6 +3156,9 @@ static int io_req_defer(struct io_kiocb
-       /* Still need defer if there is pending req in defer list. */
-       if (!req_need_defer(req) && list_empty(&ctx->defer_list))
-               return 0;
-+      /* iovec is already imported */
-+      if (req->flags & REQ_F_NEED_CLEANUP)
-+              return 0;
-       if (!req->io && io_alloc_async_ctx(req))
-               return -EAGAIN;
index 385923539d51c049f7f273068ab2a71853464b29..fa95957f2b3b44b93ecdae306427a6108faa97a8 100644 (file)
@@ -22,7 +22,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/io_uring.c
 +++ b/fs/io_uring.c
-@@ -1980,6 +1980,12 @@ static int io_write(struct io_kiocb *req
+@@ -1978,6 +1978,12 @@ static int io_write(struct io_kiocb *req
                        ret2 = call_write_iter(req->file, kiocb, &iter);
                else
                        ret2 = loop_rw_iter(WRITE, req->file, kiocb, &iter);
index acf23821504296a4dce9cf8299f3252b5ba88add..395fddce608ed867b31bc5aa90695d6b8de2ee08 100644 (file)
@@ -1,5 +1,4 @@
 io_uring-fix-deferred-req-iovec-leak.patch
-io_uring-fix-double-prep-iovec-leak.patch
 io_uring-retry-raw-bdev-writes-if-we-hit-eopnotsupp.patch
 input-synaptics-switch-t470s-to-rmi4-by-default.patch
 input-synaptics-enable-smbus-on-thinkpad-l470.patch