CVE-2025-68763: crypto: starfive - Correctly handle return of sg_nents_for_len
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
crypto: starfive - Correctly handle return of sg_nents_for_len
The return value of sg_nents_for_len was assigned to an unsigned long in starfive_hash_digest, causing negative error codes to be converted to large positive integers.
Add error checking for sg_nents_for_len and return immediately on failure to prevent potential buffer overflows.
The Linux kernel CVE team has assigned CVE-2025-68763 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.5 with commit 7883d1b28a2b0e62edcacea22de6b36a1918b15a and fixed in 6.12.63 with commit 0c3854d65cc4402cb8c52d4d773450a06efecab6 Issue introduced in 6.5 with commit 7883d1b28a2b0e62edcacea22de6b36a1918b15a and fixed in 6.17.13 with commit 1af5c973dd744e29fa22121f43e8646b7a7a71a7 Issue introduced in 6.5 with commit 7883d1b28a2b0e62edcacea22de6b36a1918b15a and fixed in 6.18.2 with commit 9b3f71cf02e04cfaa482155e3078707fe7f8aef4 Issue introduced in 6.5 with commit 7883d1b28a2b0e62edcacea22de6b36a1918b15a and fixed in 6.19-rc1 with commit e9eb52037a529fbb307c290e9951a62dd728b03d
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-68763
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/crypto/starfive/jh7110-hash.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/0c3854d65cc4402cb8c52d4d773450a06efecab6 https://git.kernel.org/stable/c/1af5c973dd744e29fa22121f43e8646b7a7a71a7 https://git.kernel.org/stable/c/9b3f71cf02e04cfaa482155e3078707fe7f8aef4 https://git.kernel.org/stable/c/e9eb52037a529fbb307c290e9951a62dd728b03d