summaryrefslogtreecommitdiff
path: root/sound/ac97
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2018-12-01 01:09:43 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-01 01:56:14 +0300
commitdcf7fe9d89763a28e0f43975b422ff141fe79e43 (patch)
treefb2670e4ffae539affd0749b65cc5b3b8f6d5dd4 /sound/ac97
parente2a50c1f64145a04959df2442305d57307e5395a (diff)
downloadlinux-dcf7fe9d89763a28e0f43975b422ff141fe79e43.tar.xz
userfaultfd: shmem: UFFDIO_COPY: set the page dirty if VM_WRITE is not set
Set the page dirty if VM_WRITE is not set because in such case the pte won't be marked dirty and the page would be reclaimed without writepage (i.e. swapout in the shmem case). This was found by source review. Most apps (certainly including QEMU) only use UFFDIO_COPY on PROT_READ|PROT_WRITE mappings or the app can't modify the memory in the first place. This is for correctness and it could help the non cooperative use case to avoid unexpected data loss. Link: http://lkml.kernel.org/r/20181126173452.26955-6-aarcange@redhat.com Reviewed-by: Hugh Dickins <hughd@google.com> Cc: stable@vger.kernel.org Fixes: 4c27fe4c4c84 ("userfaultfd: shmem: add shmem_mcopy_atomic_pte for userfaultfd support") Reported-by: Hugh Dickins <hughd@google.com> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Cc: Jann Horn <jannh@google.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Mike Rapoport <rppt@linux.ibm.com> Cc: Peter Xu <peterx@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound/ac97')
0 files changed, 0 insertions, 0 deletions