mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-17 19:14:47 +00:00
mm: Force TLB flush for PFNMAP mappings before unlink_file_vma()
commitb67fbebd4cupstream. Some drivers rely on having all VMAs through which a PFN might be accessible listed in the rmap for correctness. However, on X86, it was possible for a VMA with stale TLB entries to not be listed in the rmap. This was fixed in mainline with commitb67fbebd4c("mmu_gather: Force tlb-flush VM_PFNMAP vmas"), but that commit relies on preceding refactoring in commit18ba064e42("mmu_gather: Let there be one tlb_{start,end}_vma() implementation") and commit1e9fdf21a4("mmu_gather: Remove per arch tlb_{start,end}_vma()"). This patch provides equivalent protection without needing that refactoring, by forcing a TLB flush between removing PTEs in unmap_vmas() and the call to unlink_file_vma() in free_pgtables(). [This is a stable-specific rewrite of the upstream commit!] Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
18ed766f36
commit
895428ee12
1 changed files with 12 additions and 0 deletions
12
mm/mmap.c
12
mm/mmap.c
Loading…
Add table
Add a link
Reference in a new issue