# CVE-2025-21656: hwmon: (drivetemp) Fix driver producing garbage data when SCSI errors occur

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 11% of CVEs (2026-12-01)
- Published: 2025-01-21T12:18:13.222Z
- Modified: 2026-10-30T13:17:50.907Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

hwmon: (drivetemp) Fix driver producing garbage data when SCSI errors occur

scsi_execute_cmd() function can return both negative (linux codes) and
positive (scsi_cmnd result field) error codes.

Currently the driver just passes error codes of scsi_execute_cmd() to
hwmon core, which is incorrect because hwmon only checks for negative
error codes. This leads to hwmon reporting uninitialized data to
userspace in case of SCSI errors (for example if the disk drive was
disconnected).

This patch checks scsi_execute_cmd() output and returns -EIO if it's
error code is positive.

[groeck: Avoid inline variable declaration for portability]

(As written by CVE List.)

## Affected

- Linux Linux: from 5b46903d8bf372e563bf2150d46b87fff197a109 before babdf2a11329d30dc5086eb7a938a360aa490282; from 5b46903d8bf372e563bf2150d46b87fff197a109 before 0435d35f9d511fa5ddba49c9f68f947e395c93f9; from 5b46903d8bf372e563bf2150d46b87fff197a109 before f9723fd2770ef5563ff1685f72bcc1c411219c29; from 5b46903d8bf372e563bf2150d46b87fff197a109 before 53e25b10a28edaf8c2a1d3916fd8929501a50dfc; from 5b46903d8bf372e563bf2150d46b87fff197a109 before 42268d885e44af875a6474f7bba519cc6cea6a9d; from 5b46903d8bf372e563bf2150d46b87fff197a109 before 82163d63ae7a4c36142cd252388737205bb7e4b9; 5.6 (not affected: before 5.6; from 5.10.273 up to 5.10.*; from 5.15.224 up to 5.15.*; from 6.1.191 up to 6.1.*; from 6.6.72 up to 6.6.*; from 6.12.10 up to 6.12.*; from 6.13 up to *)
- linux linux_kernel: from 5.6 before 6.6.72; from 6.7 before 6.12.10; 6.13

## References

- <https://git.kernel.org/stable/c/babdf2a11329d30dc5086eb7a938a360aa490282>
- <https://git.kernel.org/stable/c/0435d35f9d511fa5ddba49c9f68f947e395c93f9>
- <https://git.kernel.org/stable/c/f9723fd2770ef5563ff1685f72bcc1c411219c29>
- <https://git.kernel.org/stable/c/53e25b10a28edaf8c2a1d3916fd8929501a50dfc> (patch)
- <https://git.kernel.org/stable/c/42268d885e44af875a6474f7bba519cc6cea6a9d> (patch)
- <https://git.kernel.org/stable/c/82163d63ae7a4c36142cd252388737205bb7e4b9> (patch)

## Sources

- CVE List: [CVE-2025-21656](https://www.cve.org/CVERecord?id=CVE-2025-21656), CVE Terms of Use, modified 2026-10-30
- NVD: [CVE-2025-21656](https://nvd.nist.gov/vuln/detail/CVE-2025-21656), Public domain, modified 2026-10-30

---

Page: https://cve.day/CVE-2025-21656 · Whole record: https://cve.day/CVE-2025-21656.json · Rebuilt by cve.day 2026-11-25T22:58:53.451Z
