ANDROID: userfaultfd: adjust MOVE ioctl mode to confirm bug-fix

Kernel panic was observed in do_swap_page() when invoked on a previously
moved (via MOVE ioctl) page from swap-cache. This was because [1] was not
backported previously and therefore calling page_move_anon_rmap() would
set PG_anon_exclusive flag in the source folio, which shouldn't be done
for a swap-cache folio.

[1] https://lore.kernel.org/all/20231002142949.235104-3-david@redhat.com/T/#ma99279cb1eb9d5f8f23540f68ea1244de7294ca0

Bug: 413428616
Change-Id: I867aa9c85fdba111bdecb303614438312038d2fe
Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
This commit is contained in:
Lokesh Gidra
2025-04-24 21:12:50 +00:00
parent d8a28dde36
commit 70d648657b

View File

@@ -331,7 +331,7 @@ struct uffdio_move {
* to move same src folio. It's a KMI workaround and cannot be relied
* upon by userspace.
*/
#define UFFDIO_MOVE_MODE_CONFIRM_FIXED ((__u64)1<<63)
#define UFFDIO_MOVE_MODE_CONFIRM_FIXED ((__u64)1<<62)
__u64 mode;
/*
* "move" is written by the ioctl and must be at the end: the