{"id":"CVE-2024-35791","summary":"KVM: SVM: Flush pages under kvm-\u003elock to fix UAF in svm_register_enc_region()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: SVM: Flush pages under kvm-\u003elock to fix UAF in svm_register_enc_region()\n\nDo the cache flush of converted pages in svm_register_enc_region() before\ndropping kvm-\u003elock to fix use-after-free issues where region and/or its\narray of pages could be freed by a different task, e.g. if userspace has\n__unregister_enc_region_locked() already queued up for the region.\n\nNote, the \"obvious\" alternative of using local variables doesn't fully\nresolve the bug, as region-\u003epages is also dynamically allocated.  I.e. the\nregion structure itself would be fine, but region-\u003epages could be freed.\n\nFlushing multiple pages under kvm-\u003elock is unfortunate, but the entire\nflow is a rare slow path, and the manual flush is only needed on CPUs that\nlack coherency for encrypted memory.","modified":"2026-04-02T11:50:56.006241Z","published":"2024-05-17T12:24:49.520Z","related":["ALSA-2024:6567","SUSE-SU-2024:1979-1","SUSE-SU-2024:1983-1","SUSE-SU-2024:2008-1","SUSE-SU-2024:2019-1","SUSE-SU-2024:2135-1","SUSE-SU-2024:2184-1","SUSE-SU-2024:2190-1","SUSE-SU-2024:2203-1","SUSE-SU-2024:2973-1","SUSE-SU-2025:20008-1","SUSE-SU-2025:20028-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35791.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/12f8e32a5a389a5d58afc67728c76e61beee1ad4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2d13b79640b147bd77c34a5998533b2021a4122d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/4868c0ecdb6cfde7c70cf478c46e06bb9c7e5865"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5ef1d8c1ddbf696e47b226e11888eaf8d9e8e807"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e126b508ed2e616d679d85fca2fbe77bb48bbdd7"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f6d53d8a2617dd58c89171a6b9610c470ebda38a"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35791.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35791"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"4f627ecde7329e476a077bb0590db8f27bb8f912"},{"fixed":"2d13b79640b147bd77c34a5998533b2021a4122d"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"19a23da53932bc8011220bd8c410cb76012de004"},{"fixed":"e126b508ed2e616d679d85fca2fbe77bb48bbdd7"},{"fixed":"4868c0ecdb6cfde7c70cf478c46e06bb9c7e5865"},{"fixed":"12f8e32a5a389a5d58afc67728c76e61beee1ad4"},{"fixed":"f6d53d8a2617dd58c89171a6b9610c470ebda38a"},{"fixed":"5ef1d8c1ddbf696e47b226e11888eaf8d9e8e807"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"0"},{"last_affected":"f1ecde00ce1694597f923f0d25f7a797c5243d99"},{"last_affected":"848bcb0a1d96f67d075465667d3a1ad4af56311e"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-35791.json"}}],"schema_version":"1.7.5"}