]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 15:33:51 +0000 (08:33 -0700)
commiteea474f88ca0986e0a64a225308681a2e93dd5db
tree0fafa0c105a2cae63fdeddba547239391b8e1bfe
parent2a7002bade9ad69e03d5b3ff86cdca6cb0b5d8a7
userfaultfd: non-cooperative: notify about unmap of destination during mremap

commit b22823719302e88d0e2a6bb06433bd97b175a8d8 upstream.

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/mremap.c