Commit 41f7eb5
Rafael Aquini
mm/hugetlb: fix huge_pmd_unshare() vs GUP-fast race
JIRA: https://issues.redhat.com/browse/RHEL-101261
CVE: CVE-2025-38085
commit 1013af4
Author: Jann Horn <jannh@google.com>
Date: Tue May 27 23:23:54 2025 +0200
mm/hugetlb: fix huge_pmd_unshare() vs GUP-fast race
huge_pmd_unshare() drops a reference on a page table that may have
previously been shared across processes, potentially turning it into a
normal page table used in another process in which unrelated VMAs can
afterwards be installed.
If this happens in the middle of a concurrent gup_fast(), gup_fast() could
end up walking the page tables of another process. While I don't see any
way in which that immediately leads to kernel memory corruption, it is
really weird and unexpected.
Fix it with an explicit broadcast IPI through tlb_remove_table_sync_one(),
just like we do in khugepaged when removing page tables for a THP
collapse.
Link: https://lkml.kernel.org/r/20250528-hugetlb-fixes-splitrace-v2-2-1329349bad1a@google.com
Link: https://lkml.kernel.org/r/20250527-hugetlb-fixes-splitrace-v1-2-f4136f5ec58a@google.com
Fixes: 39dde65 ("[PATCH] shared page table for hugetlb page")
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Rafael Aquini <raquini@redhat.com>1 parent f253fee commit 41f7eb5
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7299 | 7299 | | |
7300 | 7300 | | |
7301 | 7301 | | |
| 7302 | + | |
| 7303 | + | |
| 7304 | + | |
| 7305 | + | |
| 7306 | + | |
| 7307 | + | |
| 7308 | + | |
7302 | 7309 | | |
7303 | 7310 | | |
7304 | 7311 | | |
| |||
0 commit comments