Commit 2d280bc8 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

io_uring: fix recvmsg setup with compat buf-select



__io_compat_recvmsg_copy_hdr() with REQ_F_BUFFER_SELECT reads out iov
len but never assigns it to iov/fast_iov, leaving sr->len with garbage.
Hopefully, following io_buffer_select() truncates it to the selected
buffer size, but the value is still may be under what was specified.

Cc: <stable@vger.kernel.org> # 5.7
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent af604703
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4499,7 +4499,8 @@ static int __io_compat_recvmsg_copy_hdr(struct io_kiocb *req,
			return -EFAULT;
		if (clen < 0)
			return -EINVAL;
		sr->len = iomsg->iov[0].iov_len;
		sr->len = clen;
		iomsg->iov[0].iov_len = clen;
		iomsg->iov = NULL;
	} else {
		ret = __import_iovec(READ, (struct iovec __user *)uiov, len,