Message ID | 20210128000927.MhVdMWp-o%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | + mm-rmap-fix-potential-pte_unmap-on-an-not-mapped-pte.patch added to -mm tree | expand |
--- a/include/linux/rmap.h~mm-rmap-fix-potential-pte_unmap-on-an-not-mapped-pte +++ a/include/linux/rmap.h @@ -213,7 +213,8 @@ struct page_vma_mapped_walk { static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw) { - if (pvmw->pte) + /* HugeTLB pte is set to the relevant page table entry without pte_mapped. */ + if (pvmw->pte && !PageHuge(pvmw->page)) pte_unmap(pvmw->pte); if (pvmw->ptl) spin_unlock(pvmw->ptl);