On Wed, Jan 15, 2025 at 04:35:07PM +0100, Peter Zijlstra wrote: > Consider: > > CPU0 CPU1 > > rcu_read_lock(); > vma = vma_lookup(mm, vaddr); > > ... cpu goes sleep for a *long time* ... > > __vma_exit_locked(); > vma_area_free() > .. > vma = vma_area_alloc(); > vma_mark_attached(); > > ... comes back once vma is re-used ... > > vma_start_read() > vm_refcount_inc(); // success!! > > At which point we need to validate vma is for mm and covers vaddr, which > is what patch 15 does, no? Also, critically, we want these reads to happen *after* the refcount increment.