{"id":"CVE-2021-47214","aliases":["CVE-2021-47214"],"related":[],"kind":"vulnerability","state":"published","title":"hugetlb, userfaultfd: fix reservation restore on userfaultfd error","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: hugetlb, userfaultfd: se corrige el error de restauración de reserva en userfaultfd Actualmente, en el caso is_continue en hugetlb_mcopy_atomic_pte(), si salimos usando \"goto out_release_unlock;\" en los casos donde idx &gt;= size, o !huge_pte_none(), el código detectará que new_pagecache_page == false, y por lo tanto llamará a restore_reserve_on_error(). En este caso, veo que restore_reserve_on_error() elimina la reserva, y la siguiente llamada a remove_inode_hugepages() incrementará h-&gt;resv_hugepages causando una fuga 100% reproducible. Deberíamos tratar el caso is_continue de forma similar a agregar una página al pagecache y establecer new_pagecache_page en true, para indicar que no hay ninguna reserva para restaurar en la ruta del error, y no necesitamos llamar a restore_reserve_on_error(). Cambie el nombre new_pagecache_page a page_in_pagecache para que quede claro.","source":"nvd"}],"published":"2024-04-10T19:01:54.543Z","modified":"2026-06-17T04:16:55.513Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"type":"git","introduced":"c7b1850dfb41d0b4154aca8dbc04777fbd75616f","fixed":"b5069d44e2fbc4a9093d005b3ef0949add3dd27e","status":"affected"},{"type":"git","introduced":"c7b1850dfb41d0b4154aca8dbc04777fbd75616f","fixed":"cc30042df6fcc82ea18acf0dace831503e60a0b7","status":"affected"},{"type":"git","version":"515b6124df6a84c957c5cc6bb6e8309dae7b1e9c","status":"affected"},{"type":"semver","introduced":"5.13.13","fixed":"5.14","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.14","status":"unaffected"},{"type":"semver","introduced":"5.15.5","lastAffected":"5.15.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.16","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.14","fixed":"5.15.5"},{"status":"affected","version":"5.13.13"},{"status":"affected","version":"5.16"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/b5069d44e2fbc4a9093d005b3ef0949add3dd27e","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/cc30042df6fcc82ea18acf0dace831503e60a0b7","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-04-12T16:35:56.915Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-47214","url":"https://www.cve.org/CVERecord?id=CVE-2021-47214","licence":"CVE Terms of Use","modified":"2026-05-23T15:19:32.932Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-47214","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-47214","licence":"Public domain","modified":"2026-06-17T04:16:55.513Z"}],"updatedAt":"2026-11-25T22:58:08.720Z","epss":{"score":0.00193,"percentile":0.09478,"date":"2026-12-01T12:00:22.000Z"}}