CVE-2021-47058·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: regmap: set debugfs_name to NULL after it is freed There is a upstream commit cffa4b2122f5("regmap:debugfs: Fix a memory leak when calling regmap_attach_dev") that adds a if condition when create name for debugfs_name. With below function invoking logical, debugfs_name is freed in regmap_debugfs_exit(), but it is not created again because of the if condition introduced by above commit. regmap_reinit_cache() regmap_debugfs_exit() ... regmap_debugfs_init() So, set debugfs_name to NULL after it is freed.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.12.4
- Published
- 2024-02-29
Affected versions
From: 5.12
Until: 5.12.4
Fixed in: 5.12.4
How to fix this CVE
Update your Linux kernel to version 5.12.4 or later to resolve a memory management issue in the regmap debugfs subsystem. This vulnerability occurs when regmap reinitializes its cache, causing a dangling pointer in the debugfs_name field that can lead to memory corruption. Applying the kernel update will ensure proper pointer cleanup and restore system stability.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your current kernel version with: uname -r | awk -F. '{print $1"."$2"."$3}'
- Verify if kernel is in the vulnerable range (5.12.0 to 5.12.3) by comparing output against fixed version 5.12.4
- Search system logs for regmap-related errors: sudo journalctl -u systemd-modules-load -b | grep -i regmap
- After patching, reboot and confirm new kernel version with: uname -r
FAQ
What is CVE-2021-47058?
CVE-2021-47058 is a memory leak vulnerability in the Linux kernel's regmap debugfs subsystem where the debugfs_name pointer is freed but not reset to NULL during cache reinitialization, potentially causing use-after-free conditions.
Is CVE-2021-47058 being actively exploited?
No, this vulnerability is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available.
What versions of Kernel are affected by CVE-2021-47058?
Linux kernel versions 5.12.0 through 5.12.3 are vulnerable; the fix was released in kernel 5.12.4.
How do I check if my server is vulnerable to CVE-2021-47058?
Run 'uname -r' and check if the kernel version is 5.12.0, 5.12.1, 5.12.2, or 5.12.3; if so, your system is vulnerable and requires immediate patching.
Does Defensia detect CVE-2021-47058?
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-2021-47058 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/2dc1554d5f0fdaf47cc5bea442b84b9226fea867
- https://git.kernel.org/stable/c/b9e569ae1da3a113b3acee8703c94777fd20938a
- https://git.kernel.org/stable/c/c764e375ae647832de1ee73d43a4bb3ef8a8f43d
- https://git.kernel.org/stable/c/d8897f7b2283a500666c85ef06e820df38ed7b52
- https://git.kernel.org/stable/c/e41a962f82e7afb5b1ee644f48ad0b3aee656268
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47058. Free for 1 server.
Get started free