crypto: starfive - Correctly handle return of sg_nents_for_len
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's StarFive crypto hash digest code converts a negative error from sg_nents_for_len into a large positive value. This can lead to a potential buffer overflow. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running Linux kernels with the StarFive crypto code should check their systems; affected versions are not specified.