userfaultfd: non-cooperative: notify about unmap of destination during mremap
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Wed, 2 Aug 2017 20:31:55 +0000 (13:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Aug 2017 23:34:46 +0000 (16:34 -0700)
commitb22823719302e88d0e2a6bb06433bd97b175a8d8
tree2851b38cbb8e223d23a35b7150e5071edaeaabe1
parent3ea277194daaeaa84ce75180ec7c7a2075027a68
userfaultfd: non-cooperative: notify about unmap of destination during mremap

When mremap is called with MREMAP_FIXED it unmaps memory at the
destination address without notifying userfaultfd monitor.

If the destination were registered with userfaultfd, the monitor has no
way to distinguish between the old and new ranges and to properly relate
the page faults that would occur in the destination region.

Fixes: 897ab3e0c49e ("userfaultfd: non-cooperative: add event for memory unmaps")
Link: http://lkml.kernel.org/r/1500276876-3350-1-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mremap.c