]> git.baikalelectronics.ru Git - kernel.git/commit
mmu_gather: Force tlb-flush VM_PFNMAP vmas
authorPeter Zijlstra <peterz@infradead.org>
Fri, 8 Jul 2022 07:18:06 +0000 (09:18 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Jul 2022 17:50:13 +0000 (10:50 -0700)
commitab18087539e86d86b6801486106a2e1ea8afecb3
tree96e359e543dd17dae340b5d87903027228c3ca92
parent35167b29df3481b835b18927d5e4b023171c34a4
mmu_gather: Force tlb-flush VM_PFNMAP vmas

Jann reported a race between munmap() and unmap_mapping_range(), where
unmap_mapping_range() will no-op once unmap_vmas() has unlinked the
VMA; however munmap() will not yet have invalidated the TLBs.

Therefore unmap_mapping_range() will complete while there are still
(stale) TLB entries for the specified range.

Mitigate this by force flushing TLBs for VM_PFNMAP ranges.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/asm-generic/tlb.h