Re: [PATCH] mm/mmu_notifier: mm/rmap.c: Fix a mmu_notifier range bug in try_to_unmap_one

From: Adam Borowski
Date: Thu Jan 10 2019 - 04:14:38 EST


On Wed, Jan 09, 2019 at 04:51:17PM -0800, Sean Christopherson wrote:
> Manifests as KVM use-after-free WARNINGs and subsequent "BUG: Bad page
> state in process X" errors when reclaiming from a KVM guest due to KVM
> removing the wrong pages from its own mappings.

With your patch, no badness happened so far. Thanks!

> Reported-by: Adam Borowski <kilobyte@xxxxxxxxxx>
> Fixes: ac46d4f3c432 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2")

> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> - mmu_notifier_range_init(&range, vma->vm_mm, vma->vm_start,
> - min(vma->vm_end, vma->vm_start +
> + mmu_notifier_range_init(&range, vma->vm_mm, address,
> + min(vma->vm_end, address +


Meow.
--
âââââââ Hans 1 was born and raised in Johannesburg, then moved to Boston,
âââââââ and has just became a naturalized citizen. Hans 2's grandparents
âââââââ came from Melanesia to DÃsseldorf, and he hasn't ever been outside
âââââââ Germany until yesterday. Which one is an African-American?