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