clk: Fix clk_hw_get_clk() when dev is NULL
In the Linux kernel, the following vulnerability has been resolved: clk: Fix clk_hw_get_clk() when dev is NULL Any registered clk_core structure can have a NULL pointer in its dev field. While never actually documented, this is evidenced by the wide usage of clk_register and clk_hw_register with a NULL device pointer, and the fact that the core of_clk_hw_register() function also passes a NULL device pointer. A call to clk_hw_get_clk() on a clk_hw struct whose clk_core is in that case will result in a NULL pointer derefence when it calls dev_name() on that NULL device pointer. Add a test for this case and use NULL as the dev_id if the device pointer is NULL.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.15.33, 5.16.19, 5.17.2
- CVEs
- CVE-2022-49187
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 17:52 UTC · Revision 1
Source evidence
clk: Fix clk_hw_get_clk() when dev is NULL
core-osv · Original sourcePublished 26 Feb 2025, 01:55 UTC
In the Linux kernel, the following vulnerability has been resolved: clk: Fix clk_hw_get_clk() when dev is NULL Any registered clk_core structure can have a NULL pointer in its dev field. While never actually documented, this is evidenced by the wide usage of clk_register and clk_hw_register with a NULL device pointer, and the fact that the core of_clk_hw_register() function also passes a NULL device pointer. A call to clk_hw_get_clk() on a clk_hw struct whose clk_core is in that case will result in a NULL pointer derefence when it calls dev_name() on that NULL device pointer. Add a test for this case and use NULL as the dev_id if the device pointer is NULL.
osv:CVE-2022-49187
Kernel
Fixed versions: 5.15.33, 5.16.19, 5.17.2
Complete source record
{
"id": "1c6f5052e9c9082dd9a70d386ded8a7306d8d162dd7456660a5b32ce749f7bc5",
"url": "https://osv.dev/vulnerability/CVE-2022-49187",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "clk: Fix clk_hw_get_clk() when dev is NULL",
"summary": "In the Linux kernel, the following vulnerability has been resolved: clk: Fix clk_hw_get_clk() when dev is NULL Any registered clk_core structure can have a NULL pointer in its dev field. While never actually documented, this is evidenced by the wide usage of clk_register and clk_hw_register with a NULL device pointer, and the fact that the core of_clk_hw_register() function also passes a NULL device pointer. A call to clk_hw_get_clk() on a clk_hw struct whose clk_core is in that case will result in a NULL pointer derefence when it calls dev_name() on that NULL device pointer. Add a test for this case and use NULL as the dev_id if the device pointer is NULL.",
"evidence": "osv:CVE-2022-49187",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.15.33",
"evidence": "/affected/1/ranges"
},
{
"value": "5.16.19",
"evidence": "/affected/1/ranges"
},
{
"value": "5.17.2",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "CVE-2022-49187",
"aliases": [
"CVE-2022-49187"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "30d6f8c15d2cd877c1f3d47d8a1064649ebe58e2"
},
{
"fixed": "4be3e4c05d8dd1b83b75652cad88c9e752ec7054"
},
{
"fixed": "d183f20cf5a7b546d4108e796b98210ceb317579"
},
{
"fixed": "23f89fe005b105f0dcc55034c13eb89f9b570fac"
},
{
"fixed": "0c1b56df451716ba207bbf59f303473643eee4fd"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49187.json"
}
},
{
"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"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49187.json"
}
}
],
"modified": "2026-10-28T02:30:38.529068023Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/0c1b56df451716ba207bbf59f303473643eee4fd",
"https://git.kernel.org/stable/c/23f89fe005b105f0dcc55034c13eb89f9b570fac",
"https://git.kernel.org/stable/c/4be3e4c05d8dd1b83b75652cad88c9e752ec7054",
"https://git.kernel.org/stable/c/d183f20cf5a7b546d4108e796b98210ceb317579",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49187.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-49187",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49187.json"
}
},
"related_cves": [
{
"value": "CVE-2022-49187",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 505516,
"published_at": "2025-02-26T01:55:36.094+00:00"
}