CVE-2021-46988
Linux Kernel Userfaultfd-Shmem Dangling Page Release Vulnerability
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.
INFO
Published Date :
Feb. 28, 2024, 9:15 a.m.
Last Modified :
Dec. 26, 2024, 3:01 p.m.
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Remotely Exploitable :
No
Impact Score :
3.6
Exploitability Score :
1.8
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2021-46988
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2021-46988
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2021-46988
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Reanalysis by [email protected]
Dec. 26, 2024
Action Type Old Value New Value Changed CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.11 up to (excluding) 4.14.233 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.15 up to (excluding) 4.19.191 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.20 up to (excluding) 5.4.120 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.5 up to (excluding) 5.10.38 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.11.22 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.12 up to (excluding) 5.12.5 *cpe:2.3:o:linux:linux_kernel:5.12:rc1:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc3:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc4:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc5:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc6:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc7:*:*:*:*:*:* OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.11 up to (excluding) 4.14.233 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.15 up to (excluding) 4.19.191 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.20 up to (excluding) 5.4.120 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.5 up to (excluding) 5.10.38 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.11.22 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.12 up to (excluding) 5.12.5 *cpe:2.3:o:linux:linux_kernel:5.13:rc1:*:*:*:*:*:* -
Initial Analysis by [email protected]
Dec. 24, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H Added CWE NIST CWE-416 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.11 up to (excluding) 4.14.233 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.15 up to (excluding) 4.19.191 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.20 up to (excluding) 5.4.120 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.5 up to (excluding) 5.10.38 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.11.22 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.12 up to (excluding) 5.12.5 *cpe:2.3:o:linux:linux_kernel:5.12:rc1:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc3:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc4:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc5:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc6:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:5.12:rc7:*:*:*:*:*:* Changed Reference Type https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f No Types Assigned https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f Patch Changed Reference Type https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f No Types Assigned https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f Patch Changed Reference Type https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de No Types Assigned https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de Patch Changed Reference Type https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de No Types Assigned https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de Patch Changed Reference Type https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 No Types Assigned https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 Patch Changed Reference Type https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 No Types Assigned https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 Patch Changed Reference Type https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69 No Types Assigned https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69 Patch Changed Reference Type https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69 No Types Assigned https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69 Patch Changed Reference Type https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c No Types Assigned https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c Patch Changed Reference Type https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c No Types Assigned https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c Patch Changed Reference Type https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330 No Types Assigned https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330 Patch Changed Reference Type https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330 No Types Assigned https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330 Patch Changed Reference Type https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 No Types Assigned https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 Patch Changed Reference Type https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 No Types Assigned https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 Patch -
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f Added Reference https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de Added Reference https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 Added Reference https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69 Added Reference https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c Added Reference https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330 Added Reference https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 28, 2024
Action Type Old Value New Value -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 14, 2024
Action Type Old Value New Value -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Feb. 28, 2024
Action Type Old Value New Value Added 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. Added Reference Linux https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c [No types assigned]
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2021-46988
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2021-46988
weaknesses.