CVE-2021-47058
📋 TL;DR
This is a use-after-free vulnerability in the Linux kernel's regmap subsystem where debugfs_name is freed but not set to NULL, potentially causing memory corruption. It affects Linux systems using the regmap framework for hardware register access. The vulnerability could lead to kernel crashes or privilege escalation.
💻 Affected Systems
- Linux kernel
📦 What is this software?
Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →⚠️ Risk & Real-World Impact
Worst Case
Kernel panic leading to system crash or local privilege escalation to root via memory corruption.
Likely Case
System instability, kernel crashes, or denial of service when regmap operations are performed.
If Mitigated
Minimal impact with proper kernel hardening and limited regmap usage.
🎯 Exploit Status
Exploitation requires local access and knowledge of regmap subsystem usage. No public exploits known.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Kernel versions with commit 2dc1554d5f0fdaf47cc5bea442b84b9226fea867 or later
Vendor Advisory: https://git.kernel.org/stable/c/2dc1554d5f0fdaf47cc5bea442b84b9226fea867
Restart Required: Yes
Instructions:
1. Update Linux kernel to patched version. 2. Check distribution-specific security advisories. 3. Reboot system after kernel update.
🔧 Temporary Workarounds
Disable debugfs for regmap
linuxPrevent debugfs_name allocation by disabling regmap debugfs support
echo 0 > /sys/kernel/debug/regmap/*/debugfs_enable
🧯 If You Can't Patch
- Restrict local user access to systems using regmap subsystem
- Implement kernel hardening measures like KASLR and stack protection
🔍 How to Verify
Check if Vulnerable:
Check kernel version and if regmap debugfs is enabled: lsmod | grep regmap
Check Version:
uname -r
Verify Fix Applied:
Verify kernel version includes the fix commit: uname -r and check kernel changelog
📡 Detection & Monitoring
Log Indicators:
- Kernel panic messages
- Oops messages related to regmap or debugfs
- System crash logs
Network Indicators:
- None - local vulnerability only
SIEM Query:
source="kernel" AND ("regmap" OR "debugfs" OR "use-after-free")
🔗 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
- https://git.kernel.org/stable/c/eb949f891226c012138ffd9df90d1e509f428ae6
- 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
- https://git.kernel.org/stable/c/eb949f891226c012138ffd9df90d1e509f428ae6