diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-12-19 07:28:26 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-12-31 13:33:12 +0100 |
commit | b87006265a1649e96e77f454e7dc47c22333635a (patch) | |
tree | 5cf9edc97da5753aec018753823924c44a6d562d /io_uring | |
parent | e2c22a38fe299c4ed58aa4606fd435048c662a3a (diff) | |
download | linux-stable-b87006265a1649e96e77f454e7dc47c22333635a.tar.gz linux-stable-b87006265a1649e96e77f454e7dc47c22333635a.tar.bz2 linux-stable-b87006265a1649e96e77f454e7dc47c22333635a.zip |
io_uring/net: ensure compat import handlers clear free_iov
commit 990a4de57e44f4f4cfc33c90d2ec5d285b7c8342 upstream.
If we're not allocating the vectors because the count is below
UIO_FASTIOV, we still do need to properly clear ->free_iov to prevent
an erronous free of on-stack data.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Fixes: 4c17a496a7a0 ("io_uring/net: fix cleanup double free free_iov init")
Cc: stable@vger.kernel.org
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index 03825b043afe..d19763d444a0 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -479,6 +479,7 @@ static int __io_compat_recvmsg_copy_hdr(struct io_kiocb *req, if (req->flags & REQ_F_BUFFER_SELECT) { compat_ssize_t clen; + iomsg->free_iov = NULL; if (msg.msg_iovlen == 0) { sr->len = 0; } else if (msg.msg_iovlen > 1) { |