summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-12-19 15:11:40 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-31 13:33:12 +0100
commitf9ef51a7055cb1abd4b58d2a8fcb87db0a58ccf2 (patch)
tree2ae2f5dfba545178ff02b8742e06b0ff65a0653b /io_uring
parentb87006265a1649e96e77f454e7dc47c22333635a (diff)
downloadlinux-stable-f9ef51a7055cb1abd4b58d2a8fcb87db0a58ccf2.tar.gz
linux-stable-f9ef51a7055cb1abd4b58d2a8fcb87db0a58ccf2.tar.bz2
linux-stable-f9ef51a7055cb1abd4b58d2a8fcb87db0a58ccf2.zip
io_uring/net: fix cleanup after recycle
commit 6c3e8955d4bd9811a6e1761eea412a14fb51a2e6 upstream. Don't access io_async_msghdr io_netmsg_recycle(), it may be reallocated. Cc: stable@vger.kernel.org Fixes: 9bb66906f23e5 ("io_uring: support multishot in recvmsg") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/9e326f4ad4046ddadf15bf34bf3fa58c6372f6b5.1671461985.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index d19763d444a0..bdd2b4e370b3 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -806,10 +806,10 @@ retry_multishot:
goto retry_multishot;
if (mshot_finished) {
- io_netmsg_recycle(req, issue_flags);
/* fast path, check for non-NULL to avoid function call */
if (kmsg->free_iov)
kfree(kmsg->free_iov);
+ io_netmsg_recycle(req, issue_flags);
req->flags &= ~REQ_F_NEED_CLEANUP;
}