Peter Xu 4980e837ca mm/pagemap: fix wr-protect even if PM_SCAN_WP_MATCHING not set
The new pagemap ioctl contains a fast path for wr-protections without
looking into category masks.  It forgets to check PM_SCAN_WP_MATCHING
before applying the wr-protections.  It can cause, e.g., pte markers
installed on archs that do not even support uffd wr-protect.

WARNING: CPU: 0 PID: 5059 at mm/memory.c:1520 zap_pte_range mm/memory.c:1520 [inline]

Link: https://lkml.kernel.org/r/20231116201547.536857-3-peterx@redhat.com
Fixes: 12f6b01a0bcb ("fs/proc/task_mmu: add fast paths to get/clear PAGE_IS_WRITTEN flag")
Signed-off-by: Peter Xu <peterx@redhat.com>
Reported-by: syzbot+7ca4b2719dc742b8d0a4@syzkaller.appspotmail.com
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Andrei Vagin <avagin@gmail.com>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-06 16:12:45 -08:00
..
2022-10-03 14:21:45 -07:00
2023-10-19 11:02:48 +02:00
2023-01-19 09:24:28 +01:00
2022-10-10 11:24:19 -07:00
2022-10-03 14:21:45 -07:00
2023-08-28 11:43:19 -07:00
2023-11-01 20:51:41 -10:00
2022-10-03 14:21:45 -07:00
2023-04-18 16:39:33 -07:00
2023-10-30 09:14:19 -10:00
2022-10-03 14:21:45 -07:00
2022-10-03 14:21:45 -07:00