{"id":"CVE-2024-35872","summary":"mm/secretmem: fix GUP-fast succeeding on secretmem folios","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/secretmem: fix GUP-fast succeeding on secretmem folios\n\nfolio_is_secretmem() currently relies on secretmem folios being LRU\nfolios, to save some cycles.\n\nHowever, folios might reside in a folio batch without the LRU flag set, or\ntemporarily have their LRU flag cleared.  Consequently, the LRU flag is\nunreliable for this purpose.\n\nIn particular, this is the case when secretmem_fault() allocates a fresh\npage and calls filemap_add_folio()-\u003efolio_add_lru().  The folio might be\nadded to the per-cpu folio batch and won't get the LRU flag set until the\nbatch was drained using e.g., lru_add_drain().\n\nConsequently, folio_is_secretmem() might not detect secretmem folios and\nGUP-fast can succeed in grabbing a secretmem folio, crashing the kernel\nwhen we would later try reading/writing to the folio, because the folio\nhas been unmapped from the directmap.\n\nFix it by removing that unreliable check.","modified":"2026-03-20T12:36:42.183754Z","published":"2024-05-19T08:34:30.096Z","related":["SUSE-SU-2024:2008-1","SUSE-SU-2024:2019-1","SUSE-SU-2024:2135-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":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35872.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/201e4aaf405dfd1308da54448654053004c579b5"},{"type":"WEB","url":"https://git.kernel.org/stable/c/43fad1d0284de30159661d0badfc3cbaf7e6f8f8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/65291dcfcf8936e1b23cfd7718fdfde7cfaf7706"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6564b014af92b677c1f07c44d7f5b595d589cf6e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9c2b4b657739ecda38e3b383354a29566955ac48"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35872.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35872"},{"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":"1507f51255c9ff07d75909a84e7c0d7f3c4b2f49"},{"fixed":"6564b014af92b677c1f07c44d7f5b595d589cf6e"},{"fixed":"9c2b4b657739ecda38e3b383354a29566955ac48"},{"fixed":"43fad1d0284de30159661d0badfc3cbaf7e6f8f8"},{"fixed":"201e4aaf405dfd1308da54448654053004c579b5"},{"fixed":"65291dcfcf8936e1b23cfd7718fdfde7cfaf7706"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-35872.json"}}],"schema_version":"1.7.5"}