CVE-2021-47119

ext4: fix memory leak in ext4_fill_super

No CVSS score yet EPSS 0.25%

Published 15 Mar 2024 Updated 11 May 2026 CNA: Linux

Check your servers for CVE-2021-47119

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-47119 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Exploitation

EPSS 0.25%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 17.7% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 23 Jul 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from ac27a0ec112a089f1a5102bc8dffc79c8c815571, before 01d349a481f0591230300a9171330136f9159bcd
affected from ac27a0ec112a089f1a5102bc8dffc79c8c815571, before 1385b23396d511d5233b8b921ac3058b3f86a5e1
affected from ac27a0ec112a089f1a5102bc8dffc79c8c815571, before afd09b617db3786b6ef3dc43e28fe728cfea84df
Other versions: unaffected
Linux
affected 2.6.19
unaffected before 2.6.19
unaffected from 5.10.43 up to and including 5.10.*
unaffected from 5.12.10 up to and including 5.12.*
unaffected 5.13 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2021-47119 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2021-47119

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2021-47119
trivy image --scanners vuln IMAGE | grep CVE-2021-47119

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2021-47119 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.