Skip to main content

CVE-2021-47119: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2021-47119cvecve-2021-47119
Published: Fri Mar 15 2024 (03/15/2024, 20:14:25 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ext4: fix memory leak in ext4_fill_super Buffer head references must be released before calling kill_bdev(); otherwise the buffer head (and its page referenced by b_data) will not be freed by kill_bdev, and subsequently that bh will be leaked. If blocksizes differ, sb_set_blocksize() will kill current buffers and page cache by using kill_bdev(). And then super block will be reread again but using correct blocksize this time. sb_set_blocksize() didn't fully free superblock page and buffer head, and being busy, they were not freed and instead leaked. This can easily be reproduced by calling an infinite loop of: systemctl start <ext4_on_lvm>.mount, and systemctl stop <ext4_on_lvm>.mount ... since systemd creates a cgroup for each slice which it mounts, and the bh leak get amplified by a dying memory cgroup that also never gets freed, and memory consumption is much more easily noticed.

AI-Powered Analysis

AILast updated: 06/30/2025, 21:58:11 UTC

Technical Analysis

CVE-2021-47119 is a vulnerability in the Linux kernel's ext4 filesystem implementation, specifically related to the ext4_fill_super function. The issue arises from improper handling of buffer head references before invoking kill_bdev(), a function responsible for releasing block device buffers. When blocksizes differ, the sb_set_blocksize() function attempts to kill current buffers and page cache by calling kill_bdev() and then rereads the superblock with the correct blocksize. However, sb_set_blocksize() fails to fully free the superblock page and buffer head, leaving them busy and causing a memory leak. This leak manifests as unreleased buffer heads and their associated pages, which accumulate over time. The vulnerability can be easily reproduced by repeatedly starting and stopping a mount unit (e.g., systemctl start <ext4_on_lvm>.mount and systemctl stop <ext4_on_lvm>.mount) in an infinite loop. The issue is exacerbated by systemd's creation of cgroups for each slice it mounts; the dying memory cgroup never gets freed, amplifying the buffer head leak and leading to noticeable memory consumption. Although no known exploits are reported in the wild, this vulnerability can lead to resource exhaustion on affected systems, potentially degrading system performance or causing denial of service due to memory exhaustion. The vulnerability affects Linux kernel versions identified by the given commit hashes and has been publicly disclosed as of March 15, 2024.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to servers and infrastructure running Linux with ext4 filesystems, which is common in enterprise environments. The memory leak can lead to gradual resource exhaustion, impacting system stability and availability. Critical systems that rely on frequent mount/unmount operations or dynamic volume management (e.g., LVM on ext4) are particularly vulnerable. Over time, the leak could cause system slowdowns, crashes, or forced reboots, disrupting business operations and potentially leading to data unavailability. In environments with high systemd usage and containerization or cgroup-based resource management, the impact may be more pronounced. While this vulnerability does not directly compromise confidentiality or integrity, the availability impact can be significant, especially for services requiring high uptime. European organizations in sectors such as finance, healthcare, telecommunications, and government, which heavily rely on Linux-based infrastructure, may face operational risks if unpatched systems are exploited or inadvertently triggered.

Mitigation Recommendations

To mitigate this vulnerability, organizations should apply the official Linux kernel patches that address the ext4_fill_super memory leak as soon as they become available. In the interim, administrators should monitor memory usage on systems running ext4 filesystems, particularly those with frequent mount/unmount cycles or heavy systemd cgroup usage. Limiting or avoiding rapid repeated mount/unmount operations can reduce the risk of triggering the leak. Implementing resource limits on cgroups to prevent excessive memory consumption and employing automated alerts for abnormal memory growth can help detect exploitation or inadvertent triggering early. Additionally, organizations should ensure that their Linux distributions are kept up to date with security patches and consider using alternative filesystems or kernel versions if immediate patching is not feasible. Regular system reboots may temporarily alleviate memory exhaustion but are not a substitute for patching. Finally, reviewing and hardening systemd configurations to minimize unnecessary cgroup creation and mount operations can reduce exposure.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-03-04T18:12:48.838Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe9daa

Added to database: 5/21/2025, 9:09:08 AM

Last enriched: 6/30/2025, 9:58:11 PM

Last updated: 8/17/2025, 12:08:34 PM

Views: 15

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats