mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
io_uring/net: fix cleanup after recycle
commit6c3e8955d4
upstream. Don't access io_async_msghdr io_netmsg_recycle(), it may be reallocated. Cc: stable@vger.kernel.org Fixes:9bb66906f2
("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>
This commit is contained in:
parent
b87006265a
commit
f9ef51a705
1 changed files with 1 additions and 1 deletions
|
@ -806,10 +806,10 @@ int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue