]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vhost: vringh: Fix copy_to_iter return value check
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 25 Sep 2025 06:04:08 +0000 (02:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:37 +0000 (11:56 +0200)
commitbd71e7e0a612740e4de5524880c7cd40293af5f7
tree75ce886e1e9d55c0294fcd3b3c445f7bf986cc56
parent114e05344763a102a8844efd96ec06ba99293ccd
vhost: vringh: Fix copy_to_iter return value check

[ Upstream commit 439263376c2c4e126cac0d07e4987568de4eaba5 ]

The return value of copy_to_iter can't be negative, check whether the
copied length is equal to the requested length instead of checking for
negative values.

Cc: zhang jiao <zhangjiao2@cmss.chinamobile.com>
Link: https://lore.kernel.org/all/20250910091739.2999-1-zhangjiao2@cmss.chinamobile.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: 309bba39c945 ("vringh: iterate on iotlb_translate to handle large translations")
Link: https://patch.msgid.link/cd637504a6e3967954a9e80fc1b75e8c0978087b.1758723310.git.mst@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vhost/vringh.c