Commit 990a4de5 authored by Jens Axboe's avatar Jens Axboe

io_uring/net: ensure compat import handlers clear free_iov

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: default avatarJiri Slaby <jirislaby@gmail.com>
Fixes: 4c17a496 ("io_uring/net: fix cleanup double free free_iov init")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 35d90f95
...@@ -494,6 +494,7 @@ static int __io_compat_recvmsg_copy_hdr(struct io_kiocb *req, ...@@ -494,6 +494,7 @@ static int __io_compat_recvmsg_copy_hdr(struct io_kiocb *req,
if (req->flags & REQ_F_BUFFER_SELECT) { if (req->flags & REQ_F_BUFFER_SELECT) {
compat_ssize_t clen; compat_ssize_t clen;
iomsg->free_iov = NULL;
if (msg.msg_iovlen == 0) { if (msg.msg_iovlen == 0) {
sr->len = 0; sr->len = 0;
} else if (msg.msg_iovlen > 1) { } else if (msg.msg_iovlen > 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment