CVE-2021-46988
userfaultfd: release page in error path to avoid BUG_ON
Check your servers for CVE-2021-46988
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-46988 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.
Description
In the Linux kernel, the following vulnerability has been resolved:
userfaultfd: release page in error path to avoid BUG_ON
Consider the following sequence of events:
1. Userspace issues a UFFD ioctl, which ends up calling into shmem_mfill_atomic_pte(). We successfully account the blocks, we shmem_alloc_page(), but then the copy_from_user() fails. We return -ENOENT. We don't release the page we allocated. 2. Our caller detects this error code, tries the copy_from_user() after dropping the mmap_lock, and retries, calling back into shmem_mfill_atomic_pte(). 3. Meanwhile, let's say another process filled up the tmpfs being used. 4. So shmem_mfill_atomic_pte() fails to account blocks this time, and immediately returns - without releasing the page.
This triggers a BUG_ON in our caller, which asserts that the page should always be consumed, unless -ENOENT is returned.
To fix this, detect if we have such a "dangling" page when accounting fails, and if so, release it before returning.
Exploitation
EPSS 0.24%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 16.1% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 21 Jun 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.
| Product | Versions |
|---|---|
| Linux |
affected from cb658a453b9327ce96ce5222c24d162b5b65b564, before 319116227e52d49eee671f0aa278bac89b3c1b69 affected from cb658a453b9327ce96ce5222c24d162b5b65b564, before 07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f affected from cb658a453b9327ce96ce5222c24d162b5b65b564, before b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 affected from cb658a453b9327ce96ce5222c24d162b5b65b564, before 140cfd9980124aecb6c03ef2e69c72d0548744de affected from cb658a453b9327ce96ce5222c24d162b5b65b564, before ad53127973034c63b5348715a1043d0e80ceb330 affected from cb658a453b9327ce96ce5222c24d162b5b65b564, before 2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 affected from cb658a453b9327ce96ce5222c24d162b5b65b564, before 7ed9d238c7dbb1fdb63ad96a6184985151b0171c
Other versions: unaffected
|
| Linux |
affected 4.11 unaffected before 4.11 unaffected from 4.14.233 up to and including 4.14.* unaffected from 4.19.191 up to and including 4.19.* unaffected from 5.4.120 up to and including 5.4.* unaffected from 5.10.38 up to and including 5.10.* unaffected from 5.11.22 up to and including 5.11.* unaffected from 5.12.5 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-46988 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2021-46988
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-46988
trivy image --scanners vuln IMAGE | grep CVE-2021-46988
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
- https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69 git.kernel.org
- https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f git.kernel.org
- https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 git.kernel.org
- https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de git.kernel.org
- https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330 git.kernel.org
- https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 git.kernel.org
- https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c git.kernel.org
Source: the record CVE-2021-46988 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.
Vulnpocalypse