In the Linux kernel, the following vulnerability has been resolved:
thermal: intelpowerclamp: Use getcpu() instead of smpprocessorid() to avoid crash
When CPU 0 is offline and intel_powerclamp is used to inject idle, it generates kernel BUG:
BUG: using smpprocessorid() in preemptible [00000000] code: bash/15687 caller is debugsmpprocessorid+0x17/0x20 CPU: 4 PID: 15687 Comm: bash Not tainted 5.19.0-rc7+ #57 Call Trace: <TASK> dumpstacklvl+0x49/0x63 dumpstack+0x10/0x16 checkpreemptiondisabled+0xdd/0xe0 debugsmpprocessorid+0x17/0x20 powerclampsetcurstate+0x7f/0xf9 [intel_powerclamp] ... ...
Here CPU 0 is the control CPU by default and changed to the current CPU, if CPU 0 offlined. This check has to be performed under cpusreadlock(), hence the above warning.
Use getcpu() instead of smpprocessor_id() to avoid this BUG.
[ rjw: Subject edits ]
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50494.json",
"cna_assigner": "Linux"
}[
{
"signature_type": "Function",
"digest": {
"function_hash": "20920780007309518724784699118766879695",
"length": 368.0
},
"deprecated": false,
"id": "CVE-2022-50494-02d33422",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6904727db0eb62fb0c2dce1cf331c341d97ee4b7",
"target": {
"file": "drivers/thermal/intel_powerclamp.c",
"function": "start_power_clamp"
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/thermal/intel/intel_powerclamp.c"
},
"id": "CVE-2022-50494-0a69025f",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6e2a347b304224b2aeb1c0ea000d1cf8a02cc592",
"digest": {
"line_hashes": [
"131771313902940439028873542255022701870",
"332876738285989481032311212682608434909",
"30814022356226286176462913817352003299",
"127669569150768444267583525642090629342",
"67636484828877856534448613268056760737"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"digest": {
"line_hashes": [
"131771313902940439028873542255022701870",
"332876738285989481032311212682608434909",
"30814022356226286176462913817352003299",
"127669569150768444267583525642090629342",
"67636484828877856534448613268056760737"
],
"threshold": 0.9
},
"signature_version": "v1",
"id": "CVE-2022-50494-18a965e5",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@418fae0700e85a498062424f8656435c32cdb200",
"target": {
"file": "drivers/thermal/intel/intel_powerclamp.c"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/thermal/intel/intel_powerclamp.c",
"function": "start_power_clamp"
},
"id": "CVE-2022-50494-1e72ac87",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6e2a347b304224b2aeb1c0ea000d1cf8a02cc592",
"digest": {
"function_hash": "20920780007309518724784699118766879695",
"length": 368.0
}
},
{
"signature_type": "Line",
"target": {
"file": "drivers/thermal/intel/intel_powerclamp.c"
},
"deprecated": false,
"id": "CVE-2022-50494-79408558",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5614908434451aafbf9b24cb5247cf1d21269f76",
"digest": {
"line_hashes": [
"131771313902940439028873542255022701870",
"332876738285989481032311212682608434909",
"30814022356226286176462913817352003299",
"127669569150768444267583525642090629342",
"67636484828877856534448613268056760737"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"target": {
"file": "drivers/thermal/intel/intel_powerclamp.c",
"function": "start_power_clamp"
},
"deprecated": false,
"id": "CVE-2022-50494-7d1da510",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@418fae0700e85a498062424f8656435c32cdb200",
"digest": {
"function_hash": "20920780007309518724784699118766879695",
"length": 368.0
}
},
{
"signature_type": "Line",
"target": {
"file": "drivers/thermal/intel_powerclamp.c"
},
"deprecated": false,
"id": "CVE-2022-50494-7eea7d85",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6904727db0eb62fb0c2dce1cf331c341d97ee4b7",
"digest": {
"line_hashes": [
"94608967585207474965578222616323548841",
"124662208762369379470588409985764541946",
"30814022356226286176462913817352003299",
"127669569150768444267583525642090629342",
"67636484828877856534448613268056760737"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"target": {
"file": "drivers/thermal/intel_powerclamp.c"
},
"deprecated": false,
"id": "CVE-2022-50494-91181a46",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f91f66c568b316b19cb042cf50584467b3bdff4",
"digest": {
"line_hashes": [
"94608967585207474965578222616323548841",
"124662208762369379470588409985764541946",
"30814022356226286176462913817352003299",
"127669569150768444267583525642090629342",
"67636484828877856534448613268056760737"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"function_hash": "20920780007309518724784699118766879695",
"length": 368.0
},
"id": "CVE-2022-50494-b6da9b57",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f91f66c568b316b19cb042cf50584467b3bdff4",
"target": {
"file": "drivers/thermal/intel_powerclamp.c",
"function": "start_power_clamp"
}
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"function_hash": "20920780007309518724784699118766879695",
"length": 368.0
},
"id": "CVE-2022-50494-c2eec876",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5614908434451aafbf9b24cb5247cf1d21269f76",
"target": {
"file": "drivers/thermal/intel/intel_powerclamp.c",
"function": "start_power_clamp"
}
}
]
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50494.json"