Message ID | e90c8f0dbae836632b669c2afc434006a00d4a67.1657721478.git.josef@toxicpanda.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] mm: fix page leak with multiple threads mapping the same page | expand |
diff --git a/mm/memory.c b/mm/memory.c index 7a089145cad4..207b29b09286 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4369,9 +4369,12 @@ vm_fault_t finish_fault(struct vm_fault *vmf) return VM_FAULT_OOM; } - /* See comment in handle_pte_fault() */ + /* + * See comment in handle_pte_fault() for how this scenario happens, we + * need to return NOPAGE so that we drop this page. + */ if (pmd_devmap_trans_unstable(vmf->pmd)) - return 0; + return VM_FAULT_NOPAGE; vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address, &vmf->ptl);