CVE-2025-40051: vhost: vringh: Modify the return value check
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
vhost: vringh: Modify the return value check
The return value of copy_from_iter and copy_to_iter can't be negative, check whether the copied lengths are equal.
The Linux kernel CVE team has assigned CVE-2025-40051 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.0 with commit 309bba39c945ac8ab8083ac05cd6cfe5822968e0 and fixed in 6.1.156 with commit db042925a5ab7a550b710addeadbf6f72e3a8a4b Issue introduced in 6.0 with commit 309bba39c945ac8ab8083ac05cd6cfe5822968e0 and fixed in 6.6.112 with commit 78dc7362662fedaa1928fb8e4f27401c8322905d Issue introduced in 6.0 with commit 309bba39c945ac8ab8083ac05cd6cfe5822968e0 and fixed in 6.12.53 with commit baa37b1c7e29546f79c39bef0d18c4edc9f39bb1 Issue introduced in 6.0 with commit 309bba39c945ac8ab8083ac05cd6cfe5822968e0 and fixed in 6.17.3 with commit cfa0654402c06d086201a9ff167eb95da5844fc3 Issue introduced in 6.0 with commit 309bba39c945ac8ab8083ac05cd6cfe5822968e0 and fixed in 6.18-rc1 with commit 82a8d0fda55b35361ee7f35b54fa2b66d7847d2b
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-40051
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/vhost/vringh.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/db042925a5ab7a550b710addeadbf6f72e3a8a4b https://git.kernel.org/stable/c/78dc7362662fedaa1928fb8e4f27401c8322905d https://git.kernel.org/stable/c/baa37b1c7e29546f79c39bef0d18c4edc9f39bb1 https://git.kernel.org/stable/c/cfa0654402c06d086201a9ff167eb95da5844fc3 https://git.kernel.org/stable/c/82a8d0fda55b35361ee7f35b54fa2b66d7847d2b