CVE-2022-49187

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49187
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49187.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49187
Downstream
Related
Published
2025-02-26T01:55:36Z
Modified
2025-10-21T09:22:22.521626Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
clk: Fix clk_hw_get_clk() when dev is NULL
Details

In the Linux kernel, the following vulnerability has been resolved:

clk: Fix clkhwget_clk() when dev is NULL

Any registered clkcore structure can have a NULL pointer in its dev field. While never actually documented, this is evidenced by the wide usage of clkregister and clkhwregister with a NULL device pointer, and the fact that the core ofclkhw_register() function also passes a NULL device pointer.

A call to clkhwgetclk() on a clkhw struct whose clkcore is in that case will result in a NULL pointer derefence when it calls devname() on that NULL device pointer.

Add a test for this case and use NULL as the dev_id if the device pointer is NULL.

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
30d6f8c15d2cd877c1f3d47d8a1064649ebe58e2
Fixed
4be3e4c05d8dd1b83b75652cad88c9e752ec7054
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
30d6f8c15d2cd877c1f3d47d8a1064649ebe58e2
Fixed
d183f20cf5a7b546d4108e796b98210ceb317579
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
30d6f8c15d2cd877c1f3d47d8a1064649ebe58e2
Fixed
23f89fe005b105f0dcc55034c13eb89f9b570fac
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
30d6f8c15d2cd877c1f3d47d8a1064649ebe58e2
Fixed
0c1b56df451716ba207bbf59f303473643eee4fd

Affected versions

v5.*

v5.10
v5.10-rc2
v5.10-rc3
v5.10-rc4
v5.10-rc5
v5.10-rc6
v5.10-rc7
v5.11
v5.11-rc1
v5.11-rc2
v5.11-rc3
v5.11-rc4
v5.11-rc5
v5.11-rc6
v5.11-rc7
v5.12
v5.12-rc1
v5.12-rc1-dontuse
v5.12-rc2
v5.12-rc3
v5.12-rc4
v5.12-rc5
v5.12-rc6
v5.12-rc7
v5.12-rc8
v5.13
v5.13-rc1
v5.13-rc2
v5.13-rc3
v5.13-rc4
v5.13-rc5
v5.13-rc6
v5.13-rc7
v5.14
v5.14-rc1
v5.14-rc2
v5.14-rc3
v5.14-rc4
v5.14-rc5
v5.14-rc6
v5.14-rc7
v5.15
v5.15-rc1
v5.15-rc2
v5.15-rc3
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.15.1
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.2
v5.15.20
v5.15.21
v5.15.22
v5.15.23
v5.15.24
v5.15.25
v5.15.26
v5.15.27
v5.15.28
v5.15.29
v5.15.3
v5.15.30
v5.15.31
v5.15.32
v5.15.4
v5.15.5
v5.15.6
v5.15.7
v5.15.8
v5.15.9
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.16.1
v5.16.10
v5.16.11
v5.16.12
v5.16.13
v5.16.14
v5.16.15
v5.16.16
v5.16.17
v5.16.18
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.16.8
v5.16.9
v5.17
v5.17-rc1
v5.17-rc2
v5.17-rc3
v5.17-rc4
v5.17-rc5
v5.17-rc6
v5.17-rc7
v5.17-rc8
v5.17.1

Database specific

vanir_signatures

[
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4be3e4c05d8dd1b83b75652cad88c9e752ec7054",
        "id": "CVE-2022-49187-1b094780",
        "deprecated": false,
        "target": {
            "function": "clk_hw_get_clk",
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "length": 158.0,
            "function_hash": "2690565258253367468722749268369794266"
        },
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23f89fe005b105f0dcc55034c13eb89f9b570fac",
        "id": "CVE-2022-49187-239a4f93",
        "deprecated": false,
        "target": {
            "function": "clk_hw_get_clk",
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "length": 158.0,
            "function_hash": "2690565258253367468722749268369794266"
        },
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0c1b56df451716ba207bbf59f303473643eee4fd",
        "id": "CVE-2022-49187-46e05f5f",
        "deprecated": false,
        "target": {
            "function": "clk_hw_get_clk",
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "length": 158.0,
            "function_hash": "2690565258253367468722749268369794266"
        },
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0c1b56df451716ba207bbf59f303473643eee4fd",
        "id": "CVE-2022-49187-80bbea75",
        "deprecated": false,
        "target": {
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "295629136468332849359497586242922704760",
                "193912205706213029377236624212529572083",
                "26980918133287637825252568530273799209",
                "83979029425159114417689650974291696005",
                "307177786587490301786506753705498652761"
            ]
        },
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4be3e4c05d8dd1b83b75652cad88c9e752ec7054",
        "id": "CVE-2022-49187-8a913f96",
        "deprecated": false,
        "target": {
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "295629136468332849359497586242922704760",
                "193912205706213029377236624212529572083",
                "26980918133287637825252568530273799209",
                "83979029425159114417689650974291696005",
                "307177786587490301786506753705498652761"
            ]
        },
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d183f20cf5a7b546d4108e796b98210ceb317579",
        "id": "CVE-2022-49187-a2ec40e6",
        "deprecated": false,
        "target": {
            "function": "clk_hw_get_clk",
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "length": 158.0,
            "function_hash": "2690565258253367468722749268369794266"
        },
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d183f20cf5a7b546d4108e796b98210ceb317579",
        "id": "CVE-2022-49187-a3bcb32a",
        "deprecated": false,
        "target": {
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "295629136468332849359497586242922704760",
                "193912205706213029377236624212529572083",
                "26980918133287637825252568530273799209",
                "83979029425159114417689650974291696005",
                "307177786587490301786506753705498652761"
            ]
        },
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23f89fe005b105f0dcc55034c13eb89f9b570fac",
        "id": "CVE-2022-49187-affaa803",
        "deprecated": false,
        "target": {
            "file": "drivers/clk/clk.c"
        },
        "signature_version": "v1",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "295629136468332849359497586242922704760",
                "193912205706213029377236624212529572083",
                "26980918133287637825252568530273799209",
                "83979029425159114417689650974291696005",
                "307177786587490301786506753705498652761"
            ]
        },
        "signature_type": "Line"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.33
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.19
Type
ECOSYSTEM
Events
Introduced
5.17.0
Fixed
5.17.2