Re: [PATCH v2] mm/memory.c: do_fault: avoid usage of stale vm_area_struct

From: Peter Zijlstra
Date: Sat Mar 02 2019 - 13:46:30 EST


On Sat, Mar 02, 2019 at 07:19:39PM +0100, Jan Stancek wrote:
> static vm_fault_t do_fault(struct vm_fault *vmf)
> {
> struct vm_area_struct *vma = vmf->vma;
> + struct mm_struct *vm_mm = READ_ONCE(vma->vm_mm);

Would this not need a corresponding WRITE_ONCE() in vma_init() ?