# CVE-2021-47058: regmap: set debugfs\_name to NULL after it is freed

> 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, NVD) `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.25% (percentile 10, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-02-29T22:37:33.232Z
- **Modified:** 2026-06-17T04:16:20.450Z

## Who should check

- Anyone running Linux \>= 5b654b03007917f3f1015b2a5c288c1ea6ae8f65, \< 2dc1554d5f0fdaf47cc5bea442b84b9226fea867; \>= 480c5e9c7e4c76c01d5f1f7b73832d7b77e6b427, \< d8897f7b2283a500666c85ef06e820df38ed7b52; \>= c9698380b01aed3281160d3ab25749b57d6913b8, \< eb949f891226c012138ffd9df90d1e509f428ae6; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< c764e375ae647832de1ee73d43a4bb3ef8a8f43d; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< b9e569ae1da3a113b3acee8703c94777fd20938a; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< e41a962f82e7afb5b1ee644f48ad0b3aee656268; \>= 4.19.168, \< 4.19.191; \>= 5.4.90, \< 5.4.119; \>= 5.10.8, \< 5.10.37
- Anyone running Linux 5.11

## Description

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.

## Affected and fixed versions

- Linux: \>= 5b654b03007917f3f1015b2a5c288c1ea6ae8f65, \< 2dc1554d5f0fdaf47cc5bea442b84b9226fea867; \>= 480c5e9c7e4c76c01d5f1f7b73832d7b77e6b427, \< d8897f7b2283a500666c85ef06e820df38ed7b52; \>= c9698380b01aed3281160d3ab25749b57d6913b8, \< eb949f891226c012138ffd9df90d1e509f428ae6; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< c764e375ae647832de1ee73d43a4bb3ef8a8f43d; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< b9e569ae1da3a113b3acee8703c94777fd20938a; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< e41a962f82e7afb5b1ee644f48ad0b3aee656268; \>= 4.19.168, \< 4.19.191; \>= 5.4.90, \< 5.4.119; \>= 5.10.8, \< 5.10.37 (cvelist)
- Linux: 5.11 (cvelist)

## Mitigation

- Upgrade Linux to 5.10.37 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47058.md
Affected: Linux >= 5b654b03007917f3f1015b2a5c288c1ea6ae8f65, < 2dc1554d5f0fdaf47cc5bea442b84b9226fea867; >= 480c5e9c7e4c76c01d5f1f7b73832d7b77e6b427, < d8897f7b2283a500666c85ef06e820df38ed7b52; >= c9698380b01aed3281160d3ab25749b57d6913b8, < eb949f891226c012138ffd9df90d1e509f428ae6; >= cffa4b2122f5f3e53cf3d52…
Fixed in: Linux 2dc1554d5f0fdaf47cc5bea442b84b9226fea867, Linux 4.19.191, Linux 5.4.119, Linux 5.10.37

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-2021-47058 being exploited?

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

### How serious is CVE-2021-47058?

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

### Which versions are affected by CVE-2021-47058?

Linux \>= 5b654b03007917f3f1015b2a5c288c1ea6ae8f65, \< 2dc1554d5f0fdaf47cc5bea442b84b9226fea867; \>= 480c5e9c7e4c76c01d5f1f7b73832d7b77e6b427, \< d8897f7b2283a500666c85ef06e820df38ed7b52; \>= c9698380b01aed3281160d3ab25749b57d6913b8, \< eb949f891226c012138ffd9df90d1e509f428ae6; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< c764e375ae647832de1ee73d43a4bb3ef8a8f43d; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< b9e569ae1da3a113b3acee8703c94777fd20938a; \>= cffa4b2122f5f3e53cf3d529bbc74651f95856d5, \< e41a962f82e7afb5b1ee644f48ad0b3aee656268; \>= 4.19.168, \< 4.19.191; \>= 5.4.90, \< 5.4.119; \>= 5.10.8, \< 5.10.37; Linux 5.11.

### Is there a fix for CVE-2021-47058?

Yes. Fixed in Linux 2dc1554d5f0fdaf47cc5bea442b84b9226fea867, Linux 4.19.191, Linux 5.4.119, Linux 5.10.37. Upgrade Linux to 5.10.37 or later.

### How do I check if I'm affected by CVE-2021-47058?

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/2dc1554d5f0fdaf47cc5bea442b84b9226fea867>
- patch: <https://git.kernel.org/stable/c/d8897f7b2283a500666c85ef06e820df38ed7b52>
- patch: <https://git.kernel.org/stable/c/eb949f891226c012138ffd9df90d1e509f428ae6>
- patch: <https://git.kernel.org/stable/c/c764e375ae647832de1ee73d43a4bb3ef8a8f43d>
- patch: <https://git.kernel.org/stable/c/b9e569ae1da3a113b3acee8703c94777fd20938a>
- patch: <https://git.kernel.org/stable/c/e41a962f82e7afb5b1ee644f48ad0b3aee656268>

## 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-2021-47058>

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