# CVE-2021-47089: kfence: fix memory leak when cat kfence objects

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

- **Severity:** LOW 3.3
- **CVSS:** 3.3 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: Low
- **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.19% (percentile 5, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2024-03-04T18:10:27.495Z
- **Modified:** 2026-06-17T04:16:26.517Z

## Who should check

- Anyone running Linux \>= 0ce20dd840897b12ae70869c69f1ba34d6d16965, \< 2f06c8293d27f6337f907042c602c9c953988c48; \>= 0ce20dd840897b12ae70869c69f1ba34d6d16965, \< 0129ab1f268b6cf88825eae819b9b84aa0a85634
- Anyone running Linux 5.12

## Description

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

kfence: fix memory leak when cat kfence objects

Hulk robot reported a kmemleak problem:

    unreferenced object 0xffff93d1d8cc02e8 (size 248):
      comm "cat", pid 23327, jiffies 4624670141 (age 495992.217s)
      hex dump (first 32 bytes):
        00 40 85 19 d4 93 ff ff 00 10 00 00 00 00 00 00  .@..............
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace:
         seq\_open+0x2a/0x80
         full\_proxy\_open+0x167/0x1e0
         do\_dentry\_open+0x1e1/0x3a0
         path\_openat+0x961/0xa20
         do\_filp\_open+0xae/0x120
         do\_sys\_openat2+0x216/0x2f0
         do\_sys\_open+0x57/0x80
         do\_syscall\_64+0x33/0x40
         entry\_SYSCALL\_64\_after\_hwframe+0x44/0xa9
    unreferenced object 0xffff93d419854000 (size 4096):
      comm "cat", pid 23327, jiffies 4624670141 (age 495992.217s)
      hex dump (first 32 bytes):
        6b 66 65 6e 63 65 2d 23 32 35 30 3a 20 30 78 30  kfence-\#250: 0x0
        30 30 30 30 30 30 30 37 35 34 62 64 61 31 32 2d  0000000754bda12-
      backtrace:
         seq\_read\_iter+0x313/0x440
         seq\_read+0x14b/0x1a0
         full\_proxy\_read+0x56/0x80
         vfs\_read+0xa5/0x1b0
         ksys\_read+0xa0/0xf0
         do\_syscall\_64+0x33/0x40
         entry\_SYSCALL\_64\_after\_hwframe+0x44/0xa9

I find that we can easily reproduce this problem with the following
commands:

	cat /sys/kernel/debug/kfence/objects
	echo scan \> /sys/kernel/debug/kmemleak
	cat /sys/kernel/debug/kmemleak

The leaked memory is allocated in the stack below:

    do\_syscall\_64
      do\_sys\_open
        do\_dentry\_open
          full\_proxy\_open
            seq\_open            ---\> alloc seq\_file
      vfs\_read
        full\_proxy\_read
          seq\_read
            seq\_read\_iter
              traverse          ---\> alloc seq\_buf

And it should have been released in the following process:

    do\_syscall\_64
      syscall\_exit\_to\_user\_mode
        exit\_to\_user\_mode\_prepare
          task\_work\_run
            \_\_\_\_fput
              \_\_fput
                full\_proxy\_release  ---\> free here

However, the release function corresponding to file\_operations is not
implemented in kfence.  As a result, a memory leak occurs.  Therefore,
the solution to this problem is to implement the corresponding release
function.

## Affected and fixed versions

- Linux: \>= 0ce20dd840897b12ae70869c69f1ba34d6d16965, \< 2f06c8293d27f6337f907042c602c9c953988c48; \>= 0ce20dd840897b12ae70869c69f1ba34d6d16965, \< 0129ab1f268b6cf88825eae819b9b84aa0a85634 (cvelist)
- Linux: 5.12 (cvelist)

## Mitigation

- Upgrade Linux to 0129ab1f268b6cf88825eae819b9b84aa0a85634 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-47089. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47089.md
Affected: Linux >= 0ce20dd840897b12ae70869c69f1ba34d6d16965, < 2f06c8293d27f6337f907042c602c9c953988c48; >= 0ce20dd840897b12ae70869c69f1ba34d6d16965, < 0129ab1f268b6cf88825eae819b9b84aa0a85634; Linux 5.12
Fixed in: Linux 2f06c8293d27f6337f907042c602c9c953988c48, Linux 0129ab1f268b6cf88825eae819b9b84aa0a85634

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-47089 being exploited?

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

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

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

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

Linux \>= 0ce20dd840897b12ae70869c69f1ba34d6d16965, \< 2f06c8293d27f6337f907042c602c9c953988c48; \>= 0ce20dd840897b12ae70869c69f1ba34d6d16965, \< 0129ab1f268b6cf88825eae819b9b84aa0a85634; Linux 5.12.

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

Yes. Fixed in Linux 2f06c8293d27f6337f907042c602c9c953988c48, Linux 0129ab1f268b6cf88825eae819b9b84aa0a85634. Upgrade Linux to 0129ab1f268b6cf88825eae819b9b84aa0a85634 or later.

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

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/2f06c8293d27f6337f907042c602c9c953988c48>
- patch: <https://git.kernel.org/stable/c/0129ab1f268b6cf88825eae819b9b84aa0a85634>

## 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-47089>

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