From 70d648657b1e26cf030406c6afd33c72f442a45d Mon Sep 17 00:00:00 2001 From: Lokesh Gidra Date: Thu, 24 Apr 2025 21:12:50 +0000 Subject: [PATCH] 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 --- include/uapi/linux/userfaultfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h index ffdbefb3c5d5..dfac99ea1b08 100644 --- a/include/uapi/linux/userfaultfd.h +++ b/include/uapi/linux/userfaultfd.h @@ -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