CVE-2022-50189

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-50189
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50189.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50189
Downstream
Published
2025-06-18T11:03:35Z
Modified
2025-10-21T12:00:39.501990Z
Summary
tools/power turbostat: Fix file pointer leak
Details

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]

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
eae97e053fe306edbbe60c934031edf9a8affd3f
Fixed
2ebf6f5946817f33fb33e613e359229e98164eb3
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
eae97e053fe306edbbe60c934031edf9a8affd3f
Fixed
5e5fd36c58d6c820f7292ee492c3731c9a104a41

Affected versions

v5.*

v5.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.19
v5.19-rc1
v5.19-rc2
v5.19-rc3
v5.19-rc4
v5.19-rc5
v5.19-rc6
v5.19-rc7
v5.19-rc8
v5.19.1

Database specific

vanir_signatures

[
    {
        "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"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.19.0
Fixed
5.19.2