{"id":"CVE-2021-46988","published":"2024-02-28T08:13:15Z","modified":"2026-05-11T13:45:47Z","title":"userfaultfd: release page in error path to avoid BUG_ON","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nuserfaultfd: release page in error path to avoid BUG_ON\n\nConsider the following sequence of events:\n\n1. Userspace issues a UFFD ioctl, which ends up calling into\n   shmem_mfill_atomic_pte(). We successfully account the blocks, we\n   shmem_alloc_page(), but then the copy_from_user() fails. We return\n   -ENOENT. We don't release the page we allocated.\n2. Our caller detects this error code, tries the copy_from_user() after\n   dropping the mmap_lock, and retries, calling back into\n   shmem_mfill_atomic_pte().\n3. Meanwhile, let's say another process filled up the tmpfs being used.\n4. So shmem_mfill_atomic_pte() fails to account blocks this time, and\n   immediately returns - without releasing the page.\n\nThis triggers a BUG_ON in our caller, which asserts that the page\nshould always be consumed, unless -ENOENT is returned.\n\nTo fix this, detect if we have such a \"dangling\" page when accounting\nfails, and if so, release it before returning.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.0024,"percentile":0.09082,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/319116227e52d49eee671f0aa278bac89b3c1b69","tags":[]},{"url":"https://git.kernel.org/stable/c/07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f","tags":[]},{"url":"https://git.kernel.org/stable/c/b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43","tags":[]},{"url":"https://git.kernel.org/stable/c/140cfd9980124aecb6c03ef2e69c72d0548744de","tags":[]},{"url":"https://git.kernel.org/stable/c/ad53127973034c63b5348715a1043d0e80ceb330","tags":[]},{"url":"https://git.kernel.org/stable/c/2d59a0ed8b26b8f3638d8afc31f839e27759f1f6","tags":[]},{"url":"https://git.kernel.org/stable/c/7ed9d238c7dbb1fdb63ad96a6184985151b0171c","tags":[]}],"priority":{"score":1.8,"factors":[{"name":"EPSS percentile","points":1.82}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= cb658a453b9327ce96ce5222c24d162b5b65b564, < 319116227e52d49eee671f0aa278bac89b3c1b69",">= cb658a453b9327ce96ce5222c24d162b5b65b564, < 07c9b834c97d0fa3402fb7f3f3b32df370a6ff1f",">= cb658a453b9327ce96ce5222c24d162b5b65b564, < b3f1731c6d7fbc1ebe3ed8eff6d6bec56d76ff43",">= cb658a453b9327ce96ce5222c24d162b5b65b564, < 140cfd9980124aecb6c03ef2e69c72d0548744de",">= cb658a453b9327ce96ce5222c24d162b5b65b564, < ad53127973034c63b5348715a1043d0e80ceb330",">= cb658a453b9327ce96ce5222c24d162b5b65b564, < 2d59a0ed8b26b8f3638d8afc31f839e27759f1f6",">= cb658a453b9327ce96ce5222c24d162b5b65b564, < 7ed9d238c7dbb1fdb63ad96a6184985151b0171c"]},{"vendor":"Linux","product":"Linux","versions":["4.11"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-06-21T16:28:01.611692Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2021-33636","exploited":false,"provenance":"source"}}