# CVE-2024-53193: clk: clk-loongson2: Fix memory corruption bug in struct loongson2\_clk\_provider

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-787
- **Published:** 2024-12-27T13:49:35.566Z
- **Modified:** 2026-08-05T11:44:33.733Z

## Who should check

- Anyone running Linux \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 76918202615f2ba7deda14901d9fff528a180099; \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 145de18065b9840687d9b4e63746238c1da25d22; \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 6e4bf018bb040955da53dae9f8628ef8fcec2dbe
- Anyone running Linux 6.10

## Description

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

clk: clk-loongson2: Fix memory corruption bug in struct loongson2\_clk\_provider

Some heap space is allocated for the flexible structure \`struct
clk\_hw\_onecell\_data\` and its flexible-array member \`hws\` through
the composite structure \`struct loongson2\_clk\_provider\` in function
\`loongson2\_clk\_probe()\`, as shown below:

289         struct loongson2\_clk\_provider \*clp;
	...
296         for (p = data; p-\>name; p++)
297                 clks\_num++;
298
299         clp = devm\_kzalloc(dev, struct\_size(clp, clk\_data.hws, clks\_num),
300                            GFP\_KERNEL);

Then some data is written into the flexible array:

350                 clp-\>clk\_data.hws\[p-\>id\] = hw;

This corrupts \`clk\_lock\`, which is the spinlock variable immediately
following the \`clk\_data\` member in \`struct loongson2\_clk\_provider\`:

struct loongson2\_clk\_provider {
	void \_\_iomem \*base;
	struct device \*dev;
	struct clk\_hw\_onecell\_data clk\_data;
	spinlock\_t clk\_lock;	/\* protect access to DIV registers \*/
};

The problem is that the flexible structure is currently placed in the
middle of \`struct loongson2\_clk\_provider\` instead of at the end.

Fix this by moving \`struct clk\_hw\_onecell\_data clk\_data;\` to the end of
\`struct loongson2\_clk\_provider\`. Also, add a code comment to help
prevent this from happening again in case new members are added to the
structure in the future.

This change also fixes the following -Wflex-array-member-not-at-end
warning:

drivers/clk/clk-loongson2.c:32:36: warning: structure containing a flexible array member is not at the end of another structure \[-Wflex-array-member-not-at-end\]

## Affected and fixed versions

- Linux: \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 76918202615f2ba7deda14901d9fff528a180099; \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 145de18065b9840687d9b4e63746238c1da25d22; \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 6e4bf018bb040955da53dae9f8628ef8fcec2dbe (cvelist)
- Linux: 6.10 (cvelist)

## Mitigation

- Upgrade Linux to 6e4bf018bb040955da53dae9f8628ef8fcec2dbe or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-53193. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-53193.md
Affected: Linux >= 9796ec0bd04bb0e70487127d44949ca0554df5d3, < 76918202615f2ba7deda14901d9fff528a180099; >= 9796ec0bd04bb0e70487127d44949ca0554df5d3, < 145de18065b9840687d9b4e63746238c1da25d22; >= 9796ec0bd04bb0e70487127d44949ca0554df5d3, < 6e4bf018bb040955da53dae9f8628ef8fcec2dbe; Linux 6.10
Fixed in: Linux 76918202615f2ba7deda14901d9fff528a180099, Linux 145de18065b9840687d9b4e63746238c1da25d22, Linux 6e4bf018bb040955da53dae9f8628ef8fcec2dbe

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-53193 being exploited?

There is no confirmed exploitation: CVE-2024-53193 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-53193?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-53193?

Linux \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 76918202615f2ba7deda14901d9fff528a180099; \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 145de18065b9840687d9b4e63746238c1da25d22; \>= 9796ec0bd04bb0e70487127d44949ca0554df5d3, \< 6e4bf018bb040955da53dae9f8628ef8fcec2dbe; Linux 6.10.

### Is there a fix for CVE-2024-53193?

Yes. Fixed in Linux 76918202615f2ba7deda14901d9fff528a180099, Linux 145de18065b9840687d9b4e63746238c1da25d22, Linux 6e4bf018bb040955da53dae9f8628ef8fcec2dbe. Upgrade Linux to 6e4bf018bb040955da53dae9f8628ef8fcec2dbe or later.

### How do I check if I'm affected by CVE-2024-53193?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/76918202615f2ba7deda14901d9fff528a180099>
- patch: <https://git.kernel.org/stable/c/145de18065b9840687d9b4e63746238c1da25d22>
- patch: <https://git.kernel.org/stable/c/6e4bf018bb040955da53dae9f8628ef8fcec2dbe>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-53193>

HTML: <https://flawdb.com/CVE-2024-53193> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-53193>
