# CVE-2021-46940: tools/power turbostat: Fix offset overflow issue in index converting

- 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.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2024-02-27T18:40:28.063Z
- Modified: 2026-06-17T04:15:55.530Z
- Weaknesses: CWE-190
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

tools/power turbostat: Fix offset overflow issue in index converting

The idx_to_offset() function returns type int (32-bit signed), but
MSR_PKG_ENERGY_STAT is u32 and would be interpreted as a negative number.
The end result is that it hits the if (offset < 0) check in update_msr_sum()
which prevents the timer callback from updating the stat in the background when
long durations are used. The similar issue exists in offset_to_idx() and
update_msr_sum(). Fix this issue by converting the 'int' to 'off_t' accordingly.

(As written by CVE List.)

## Affected

- Linux Linux: from 9972d5d84d76982606806b2ce887f70c2f8ba60a before ea6803ff2cd1a2d7d880256bf562172b708a76ff; from 9972d5d84d76982606806b2ce887f70c2f8ba60a before dbdf22fc825fdb1d97f23230064e0f9819471628; from 9972d5d84d76982606806b2ce887f70c2f8ba60a before 337b1546cde87fb8588ddaedf0201b769baa572a; from 9972d5d84d76982606806b2ce887f70c2f8ba60a before 13a779de4175df602366d129e41782ad7168cef0; 5.10 (not affected: before 5.10; from 5.10.36 up to 5.10.*; from 5.11.20 up to 5.11.*; from 5.12.3 up to 5.12.*; from 5.13 up to *)
- linux linux_kernel: from 5.10.0 before 5.10.36; from 5.11.0 before 5.11.20; from 5.12.0 before 5.12.3

## References

- <https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff> (patch)
- <https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628> (patch)
- <https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a> (patch)
- <https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0> (patch)

## Sources

- CVE List: [CVE-2021-46940](https://www.cve.org/CVERecord?id=CVE-2021-46940), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2021-46940](https://nvd.nist.gov/vuln/detail/CVE-2021-46940), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-46940 · Whole record: https://cve.day/CVE-2021-46940.json · Rebuilt by cve.day 2026-11-25T22:58:08.578Z
