CVE-2021-47089: kfence: fix memory leak when cat kfence objects
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.
Security readout for executives and security teams
Plain-English summary
This is a low-severity Linux kernel memory leak in the KFENCE debug interface. A local user able to access that interface could cause unreleased kernel memory after reading KFENCE objects, potentially reducing availability over time. The sources do not indicate data theft, integrity impact, or known active exploitation.
Executive priority
Treat as routine patching unless you operate shared Linux systems with untrusted local users. Business risk is mainly minor availability degradation, not compromise of sensitive data, based on the supplied sources.
Technical view
KFENCE lacked the release handler corresponding to its file operations. Reading the KFENCE objects debug interface could allocate seq_file and seq_buf memory that was not freed on file close. The kernel fix implements the missing release path. CVSS is 3.3, local attack vector, low availability impact only.
Likely exposure
Exposure is limited to Linux systems running affected kernel builds with KFENCE and its debug interface accessible to a local low-privileged user. The source bundle names Linux kernel versions around 5.12 through fixed 5.15.12/5.16 lines, but exact vendor package mappings require distributor advisories.
Exploitation context
The CVE is not listed as CISA KEV in the provided bundle, and no cited source reports active exploitation. Abuse requires local access and interaction with a kernel debug interface, making broad remote exploitation unlikely from the available evidence.
Researcher notes
The public description ties the leak to missing KFENCE file_operations release handling after seq_file and seq_buf allocation. Evidence supports memory leak and low availability impact only. Avoid assuming exploitability beyond local debug interface access without vendor-specific configuration details.
Mitigation direction
Apply Linux kernel updates containing the referenced stable fixes.
Check your Linux distribution advisory for exact fixed package versions.
Restrict access to debugfs and KFENCE debug interfaces where not operationally needed.
Prioritize shared multi-user systems where local users are untrusted.
Validation and detection
Inventory Linux kernel versions and compare against vendor fixed versions.
Confirm whether KFENCE and debugfs are enabled on exposed hosts.
Check whether local non-admin users can access KFENCE debug interfaces.
Review kernel update status against the two referenced stable commits.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2021-47089 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
2ADP providers
3Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.