]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vhost: vringh: Modify the return value check
authorzhang jiao <zhangjiao2@cmss.chinamobile.com>
Wed, 10 Sep 2025 09:17:38 +0000 (17:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:39 +0000 (11:56 +0200)
commitdb042925a5ab7a550b710addeadbf6f72e3a8a4b
tree3f75298a78331016499bfe775e756c3c31c9d38f
parentf8648cb41842bc88a362e3f8c6162826161b22c3
vhost: vringh: Modify the return value check

[ Upstream commit 82a8d0fda55b35361ee7f35b54fa2b66d7847d2b ]

The return value of copy_from_iter and copy_to_iter can't be negative,
check whether the copied lengths are equal.

Fixes: 309bba39c945 ("vringh: iterate on iotlb_translate to handle large translations")
Cc: "Stefano Garzarella" <sgarzare@redhat.com>
Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
Message-Id: <20250910091739.2999-1-zhangjiao2@cmss.chinamobile.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vhost/vringh.c