{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-46940","id":"CVE-2021-46940","title":"tools/power turbostat: Fix offset overflow issue in index converting","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntools/power turbostat: Fix offset overflow issue in index converting\n\nThe idx_to_offset() function returns type int (32-bit signed), but\nMSR_PKG_ENERGY_STAT is u32 and would be interpreted as a negative number.\nThe end result is that it hits the if (offset < 0) check in update_msr_sum()\nwhich prevents the timer callback from upda","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\ntools/power turbostat: Fix offset overflow issue in index converting\n\nThe idx_to_offset() function returns type int (32-bit signed), but\nMSR_PKG_ENERGY_STAT is u32 and would be interpreted as a negative number.\nThe end result is that it hits the if (offset < 0) check in update_msr_sum()\nwhich prevents the timer callback from updating the stat in the background when\nlong durations are used. The similar issue exists in offset_to_idx() and\nupdate_msr_sum(). Fix this issue by converting the 'int' to 'off_t' accordingly.","published":"2024-02-27T18:40:28.063Z","updated":"2026-06-17T04:15:55.530Z","reserved":"2024-02-25T13:45:52.721Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},"metrics":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"OSV"}],"rating":"medium","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9972d5d84d76982606806b2ce887f70c2f8ba60a","lessThan":"ea6803ff2cd1a2d7d880256bf562172b708a76ff","status":"affected","versionType":"git"},{"version":"9972d5d84d76982606806b2ce887f70c2f8ba60a","lessThan":"dbdf22fc825fdb1d97f23230064e0f9819471628","status":"affected","versionType":"git"},{"version":"9972d5d84d76982606806b2ce887f70c2f8ba60a","lessThan":"337b1546cde87fb8588ddaedf0201b769baa572a","status":"affected","versionType":"git"},{"version":"9972d5d84d76982606806b2ce887f70c2f8ba60a","lessThan":"13a779de4175df602366d129e41782ad7168cef0","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.10","status":"affected"},{"version":"0","lessThan":"5.10","status":"unaffected","versionType":"semver"},{"version":"5.10.36","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.11.20","lessThanOrEqual":"5.11.*","status":"unaffected","versionType":"semver"},{"version":"5.12.3","lessThanOrEqual":"5.12.*","status":"unaffected","versionType":"semver"},{"version":"5.13","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-190"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0","tags":["x_transferred","Patch","fix"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00222,"epssPercentile":0.12936,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-46940","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-46940","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-46940","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-46940","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}