diff options
| author | Jann Horn <[email protected]> | 2025-05-27 21:23:54 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-06-06 05:02:24 +0000 |
| commit | 1013af4f585fccc4d3e5c5824d174de2257f7d6d (patch) | |
| tree | a37bffb609116bf8b5cf59e7b5634ea43a3d2496 /drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | |
| parent | mm/hugetlb: unshare page tables during VMA split, not before (diff) | |
| download | kernel-1013af4f585fccc4d3e5c5824d174de2257f7d6d.tar.gz kernel-1013af4f585fccc4d3e5c5824d174de2257f7d6d.zip | |
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/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 39dde65c9940 ("[PATCH] shared page table for hugetlb page")
Signed-off-by: Jann Horn <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Cc: Liam Howlett <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c')
0 files changed, 0 insertions, 0 deletions
