CVE-2022-49187 clk: Fix clk_hw_get_clk() when dev is NULL

Medium 5.5 Published Updated

A NULL pointer dereference in the Linux kernel clock subsystem can cause a system crash when accessing clock hardware with a null device pointer.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-49187?

CVE-2022-49187 is a medium-severity vulnerability in Linux kernel, published on 26 Feb 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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.

Weakness: CWE-476

Which versions are affected by CVE-2022-49187?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-49187?

Apply the vendor's patch.

Is CVE-2022-49187 being exploited?

There is no known exploitation of CVE-2022-49187 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-49187, GHSA-vwg2-4h4c-ch44, UBUNTU-CVE-2022-49187.

Is CVE-2022-49187 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free