CVE-2024-53193·Kernel vulnerability
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]
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.12.2
- Published
- 2024-12-27
Affected versions
From: 6.12
Until: 6.12.2
Fixed in: 6.12.2
How to fix this CVE
Update your Linux kernel to version 6.12.2 or later to resolve this memory corruption vulnerability in the Loongson2 clock driver. The fix relocates a flexible array member to the end of its containing structure, preventing heap overflow that could corrupt adjacent kernel data structures. Systems running kernel versions 6.12.0 through 6.12.1 should prioritize this update.
sudo dnf check-update kernel && sudo dnf upgrade kernelDefensia detects this vulnerability
How to check if you are affected
- Run `uname -r` to check your current kernel version; versions 6.12.0 through 6.12.1 are vulnerable
- Check if Loongson2 clock driver is active with `lsmod | grep clk_loongson2` or examine `/sys/module/clk_loongson2` if it exists
- Search kernel logs for memory corruption errors or spinlock warnings using `sudo dmesg | grep -i 'spinlock\|memory\|corrupt\|clk_loongson2'`
- Verify the patch is applied by checking kernel build version with `cat /proc/version` and confirming it references 6.12.2 or later
FAQ
What is CVE-2024-53193?
CVE-2024-53193 is a memory corruption vulnerability in the Linux kernel's Loongson2 clock driver where a flexible array member was incorrectly positioned within a structure, allowing heap writes to overwrite an adjacent spinlock and cause kernel instability or data corruption.
Is CVE-2024-53193 being actively exploited?
No, CVE-2024-53193 is not listed on the CISA Known Exploited Vulnerabilities catalog and no public exploits are currently available.
What versions of Kernel are affected by CVE-2024-53193?
Linux kernel versions 6.12.0, 6.12.1, and 6.12.2-rc versions prior to the final 6.12.2 release are affected; the vulnerability was resolved in kernel 6.12.2.
How do I check if my server is vulnerable to CVE-2024-53193?
Run `uname -r` and compare against version 6.12.2; if your version is 6.12.0 or 6.12.1, you are vulnerable. Also confirm the Loongson2 driver is loaded with `lsmod | grep clk_loongson2`.
Does Defensia detect CVE-2024-53193?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2024-53193 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-53193. Free for 1 server.
Get started free