{"id":"CVE-2021-47214","published":"2024-04-10T19:01:54Z","modified":"2026-05-23T15:19:32Z","title":"hugetlb, userfaultfd: fix reservation restore on userfaultfd error","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nhugetlb, userfaultfd: fix reservation restore on userfaultfd error\n\nCurrently in the is_continue case in hugetlb_mcopy_atomic_pte(), if we\nbail out using \"goto out_release_unlock;\" in the cases where idx >=\nsize, or !huge_pte_none(), the code will detect that new_pagecache_page\n== false, and so call restore_reserve_on_error().  In this case I see\nrestore_reserve_on_error() delete the reservation, and the following\ncall to remove_inode_hugepages() will increment h->resv_hugepages\ncausing a 100% reproducible leak.\n\nWe should treat the is_continue case similar to adding a page into the\npagecache and set new_pagecache_page to true, to indicate that there is\nno reservation to restore on the error path, and we need not call\nrestore_reserve_on_error().  Rename new_pagecache_page to\npage_in_pagecache to make that clear.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.00267,"percentile":0.1179,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/b5069d44e2fbc4a9093d005b3ef0949add3dd27e","tags":[]},{"url":"https://git.kernel.org/stable/c/cc30042df6fcc82ea18acf0dace831503e60a0b7","tags":[]}],"priority":{"score":2.4,"factors":[{"name":"EPSS percentile","points":2.36}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= c7b1850dfb41d0b4154aca8dbc04777fbd75616f, < b5069d44e2fbc4a9093d005b3ef0949add3dd27e",">= c7b1850dfb41d0b4154aca8dbc04777fbd75616f, < cc30042df6fcc82ea18acf0dace831503e60a0b7","515b6124df6a84c957c5cc6bb6e8309dae7b1e9c",">= 5.13.13, < 5.14"]},{"vendor":"Linux","product":"Linux","versions":["5.14"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-04-12T16:35:56.915589Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2021-33862","exploited":false,"provenance":"source"}}