CVE-2021-46988

userfaultfd: release page in error path to avoid BUG_ON

MEDIUM
5.5
CVSS Score
Published: February 28, 2024 at 08:13 AM UTC
Updated: June 17, 2026 at 04:16 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

4.11 ≤ v < 4.14.2334.11 ≤ v < 4.19.1914.11 ≤ v < 5.10.384.11 ≤ v < 5.11.224.11 ≤ v < 5.12.54.11 ≤ v < 5.134.11 ≤ v < 5.4.1204.15 ≤ v < 4.19.1914.20 ≤ v < 5.4.1205.11 ≤ v < 5.11.225.12 ≤ v < 5.12.55.5 ≤ v < 5.10.385.13 rc1cb658a453b9327ce96ce5222c24d162b5b65b564
Vendor states this is fixed in 07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f (fixed)
Vendor states this is fixed in 140cfd9980124aecb6c03ef2e69c72d0548744de (fixed)
Vendor states this is fixed in 2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 (fixed)
Vendor states this is fixed in 319116227e52d49eee671f0aa278bac89b3c1b69 (fixed)
Vendor states this is fixed in 7ed9d238c7dbb1fdb63ad96a6184985151b0171c (fixed)
Vendor states this is fixed in ad53127973034c63b5348715a1043d0e80ceb330 (fixed)
Vendor states this is fixed in b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 (fixed)
Vendor states this is fixed in 4.11 (unaffected)
Vendor states this is fixed in 4.14.233 (unaffected)
Vendor states this is fixed in 4.19.191 (unaffected)
Vendor states this is fixed in 5.10.38 (unaffected)
Vendor states this is fixed in 5.11.22 (unaffected)
Vendor states this is fixed in 5.12.5 (unaffected)
Vendor states this is fixed in 5.13 (unaffected)
Vendor states this is fixed in 5.4.120 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card