CVE-2021-46940 (GCVE-0-2021-46940)
Vulnerability from cvelistv5 – Published: 2024-02-27 18:40 – Updated: 2025-05-04 07:00
VLAI?
Title
tools/power turbostat: Fix offset overflow issue in index converting
Summary
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.
Severity ?
No CVSS data available.
Assigner
References
Impacted products
| Vendor | Product | Version | ||
|---|---|---|---|---|
| Linux | Linux |
Affected:
9972d5d84d76982606806b2ce887f70c2f8ba60a , < ea6803ff2cd1a2d7d880256bf562172b708a76ff
(git)
Affected: 9972d5d84d76982606806b2ce887f70c2f8ba60a , < dbdf22fc825fdb1d97f23230064e0f9819471628 (git) Affected: 9972d5d84d76982606806b2ce887f70c2f8ba60a , < 337b1546cde87fb8588ddaedf0201b769baa572a (git) Affected: 9972d5d84d76982606806b2ce887f70c2f8ba60a , < 13a779de4175df602366d129e41782ad7168cef0 (git) |
||
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2021-46940",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2024-03-05T20:11:09.167869Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2024-07-05T17:21:06.431Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
},
{
"providerMetadata": {
"dateUpdated": "2024-08-04T05:17:42.991Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff"
},
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628"
},
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a"
},
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0"
}
],
"title": "CVE Program Container"
}
],
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"tools/power/x86/turbostat/turbostat.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "ea6803ff2cd1a2d7d880256bf562172b708a76ff",
"status": "affected",
"version": "9972d5d84d76982606806b2ce887f70c2f8ba60a",
"versionType": "git"
},
{
"lessThan": "dbdf22fc825fdb1d97f23230064e0f9819471628",
"status": "affected",
"version": "9972d5d84d76982606806b2ce887f70c2f8ba60a",
"versionType": "git"
},
{
"lessThan": "337b1546cde87fb8588ddaedf0201b769baa572a",
"status": "affected",
"version": "9972d5d84d76982606806b2ce887f70c2f8ba60a",
"versionType": "git"
},
{
"lessThan": "13a779de4175df602366d129e41782ad7168cef0",
"status": "affected",
"version": "9972d5d84d76982606806b2ce887f70c2f8ba60a",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"tools/power/x86/turbostat/turbostat.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "5.10"
},
{
"lessThan": "5.10",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "5.10.*",
"status": "unaffected",
"version": "5.10.36",
"versionType": "semver"
},
{
"lessThanOrEqual": "5.11.*",
"status": "unaffected",
"version": "5.11.20",
"versionType": "semver"
},
{
"lessThanOrEqual": "5.12.*",
"status": "unaffected",
"version": "5.12.3",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "5.13",
"versionType": "original_commit_for_fix"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.10.36",
"versionStartIncluding": "5.10",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.11.20",
"versionStartIncluding": "5.10",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.12.3",
"versionStartIncluding": "5.10",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.13",
"versionStartIncluding": "5.10",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "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 \u003c 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 \u0027int\u0027 to \u0027off_t\u0027 accordingly."
}
],
"providerMetadata": {
"dateUpdated": "2025-05-04T07:00:44.951Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"url": "https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff"
},
{
"url": "https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628"
},
{
"url": "https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a"
},
{
"url": "https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0"
}
],
"title": "tools/power turbostat: Fix offset overflow issue in index converting",
"x_generator": {
"engine": "bippy-1.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"assignerShortName": "Linux",
"cveId": "CVE-2021-46940",
"datePublished": "2024-02-27T18:40:28.063Z",
"dateReserved": "2024-02-25T13:45:52.721Z",
"dateUpdated": "2025-05-04T07:00:44.951Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1",
"vulnerability-lookup:meta": {
"nvd": "{\"cve\":{\"id\":\"CVE-2021-46940\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-02-27T19:04:05.927\",\"lastModified\":\"2024-11-21T06:34:58.963\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"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 \u003c 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 \u0027int\u0027 to \u0027off_t\u0027 accordingly.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: herramientas/turbostat de potencia: soluciona el problema de desbordamiento de compensaci\u00f3n en la conversi\u00f3n de \u00edndice. La funci\u00f3n idx_to_offset() devuelve el tipo int (32 bits firmado), pero MSR_PKG_ENERGY_STAT es u32 y se interpretar\u00eda como negativo. n\u00famero. El resultado final es que alcanza la verificaci\u00f3n if (offset \u0026lt; 0) en update_msr_sum(), lo que evita que la devoluci\u00f3n de llamada del temporizador actualice la estad\u00edstica en segundo plano cuando se utilizan duraciones prolongadas. Existe un problema similar en offset_to_idx() y update_msr_sum(). Solucione este problema convirtiendo \u0027int\u0027 a \u0027off_t\u0027 en consecuencia.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-190\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.10.0\",\"versionEndExcluding\":\"5.10.36\",\"matchCriteriaId\":\"4E778606-3A80-42DD-996C-5570B1192986\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.11.0\",\"versionEndExcluding\":\"5.11.20\",\"matchCriteriaId\":\"EFB425F0-C28C-4B44-8B4C-AD512AA832DE\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.12.0\",\"versionEndExcluding\":\"5.12.3\",\"matchCriteriaId\":\"C3814FA3-8141-4313-A852-8C4212BE12AD\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\"]}]}}",
"vulnrichment": {
"containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:17:42.991Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-46940\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-03-05T20:11:09.167869Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-07-05T15:20:37.872Z\"}}], \"cna\": {\"title\": \"tools/power turbostat: Fix offset overflow issue in index converting\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"9972d5d84d76982606806b2ce887f70c2f8ba60a\", \"lessThan\": \"ea6803ff2cd1a2d7d880256bf562172b708a76ff\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"9972d5d84d76982606806b2ce887f70c2f8ba60a\", \"lessThan\": \"dbdf22fc825fdb1d97f23230064e0f9819471628\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"9972d5d84d76982606806b2ce887f70c2f8ba60a\", \"lessThan\": \"337b1546cde87fb8588ddaedf0201b769baa572a\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"9972d5d84d76982606806b2ce887f70c2f8ba60a\", \"lessThan\": \"13a779de4175df602366d129e41782ad7168cef0\", \"versionType\": \"git\"}], \"programFiles\": [\"tools/power/x86/turbostat/turbostat.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.10\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.10\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.10.36\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.11.20\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.11.*\"}, {\"status\": \"unaffected\", \"version\": \"5.12.3\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.12.*\"}, {\"status\": \"unaffected\", \"version\": \"5.13\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"tools/power/x86/turbostat/turbostat.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/ea6803ff2cd1a2d7d880256bf562172b708a76ff\"}, {\"url\": \"https://git.kernel.org/stable/c/dbdf22fc825fdb1d97f23230064e0f9819471628\"}, {\"url\": \"https://git.kernel.org/stable/c/337b1546cde87fb8588ddaedf0201b769baa572a\"}, {\"url\": \"https://git.kernel.org/stable/c/13a779de4175df602366d129e41782ad7168cef0\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"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 \u003c 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 \u0027int\u0027 to \u0027off_t\u0027 accordingly.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.10.36\", \"versionStartIncluding\": \"5.10\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.11.20\", \"versionStartIncluding\": \"5.10\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.12.3\", \"versionStartIncluding\": \"5.10\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.13\", \"versionStartIncluding\": \"5.10\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T07:00:44.951Z\"}}}",
"cveMetadata": "{\"cveId\": \"CVE-2021-46940\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-05-04T07:00:44.951Z\", \"dateReserved\": \"2024-02-25T13:45:52.721Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-02-27T18:40:28.063Z\", \"assignerShortName\": \"Linux\"}",
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
}
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…