]> git.baikalelectronics.ru Git - kernel.git/commit
mm/migrate: fixup setting UFFD_WP flag
authorAlistair Popple <alistair@popple.id.au>
Fri, 4 Sep 2020 23:35:58 +0000 (16:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Sep 2020 19:14:30 +0000 (12:14 -0700)
commit1f1762edcc620187f6ad0c63d83c15423b6853ad
tree3cb82fcd0eeeda39054b3a59223336c2830c3ba8
parent05576e59b069719381264bfcdd90d0d8ac701485
mm/migrate: fixup setting UFFD_WP flag

Commit 2dd1c0fd164df ("userfaultfd: wp: support swap and page migration")
introduced support for tracking the uffd wp bit during page migration.
However the non-swap PTE variant was used to set the flag for zone device
private pages which are a type of swap page.

This leads to corruption of the swap offset if the original PTE has the
uffd_wp flag set.

Fixes: 2dd1c0fd164df ("userfaultfd: wp: support swap and page migration")
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Link: https://lkml.kernel.org/r/20200825064232.10023-1-alistair@popple.id.au
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/migrate.c