In the Linux kernel, the following vulnerability has been resolved:
tools/power turbostat: Fix file pointer leak
Currently if a fscanf fails then an early return leaks an open file pointer. Fix this by fclosing the file before the return. Detected using static analysis with cppcheck:
tools/power/x86/turbostat/turbostat.c:2039:3: error: Resource leak: fp [resourceLeak]
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ebf6f5946817f33fb33e613e359229e98164eb3",
"id": "CVE-2022-50189-208bf1b9",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "get_core_throt_cnt",
"file": "tools/power/x86/turbostat/turbostat.c"
},
"digest": {
"length": 411.0,
"function_hash": "82076443347563877618583412213805125070"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5e5fd36c58d6c820f7292ee492c3731c9a104a41",
"id": "CVE-2022-50189-28712f51",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "get_core_throt_cnt",
"file": "tools/power/x86/turbostat/turbostat.c"
},
"digest": {
"length": 411.0,
"function_hash": "82076443347563877618583412213805125070"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ebf6f5946817f33fb33e613e359229e98164eb3",
"id": "CVE-2022-50189-535d9d10",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "tools/power/x86/turbostat/turbostat.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"335873600527811974429406287949517027036",
"131844349148735493041934129288511750229",
"209134410138190447579524031332998144411",
"220551312717591165497141522021578508704",
"306496854353026764392447587647537241108",
"320594258959483035301542398153498814467",
"200489583874059906615376674186764766769"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5e5fd36c58d6c820f7292ee492c3731c9a104a41",
"id": "CVE-2022-50189-a5c2fffa",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "tools/power/x86/turbostat/turbostat.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"335873600527811974429406287949517027036",
"131844349148735493041934129288511750229",
"209134410138190447579524031332998144411",
"220551312717591165497141522021578508704",
"306496854353026764392447587647537241108",
"320594258959483035301542398153498814467",
"200489583874059906615376674186764766769"
]
},
"signature_type": "Line"
}
]