mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in
authorPeter Xu <peterx@redhat.com>
Sat, 1 Oct 2022 00:25:55 +0000 (20:25 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 12 Oct 2022 22:56:46 +0000 (15:56 -0700)
commit515778e2d790652a38a24554fdb7f21420d91efc
tree0e5e96ac55e5d986733bbd2d60746eab134792d7
parent28c5609fb236807910ca347ad3e26c4567998526
mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in

When PTE_MARKER_UFFD_WP not configured, it's still possible to reach pte
marker code and trigger an warning. Add a few CONFIG_PTE_MARKER_UFFD_WP
ifdefs to make sure the code won't be reached when not compiled in.

Link: https://lkml.kernel.org/r/YzeR+R6b4bwBlBHh@x1n
Fixes: b1f9e876862d ("mm/uffd: enable write protection for shmem & hugetlbfs")
Signed-off-by: Peter Xu <peterx@redhat.com>
Reported-by: <syzbot+2b9b4f0895be09a6dec3@syzkaller.appspotmail.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Edward Liaw <edliaw@google.com>
Cc: Liu Shixin <liushixin2@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c
mm/memory.c
mm/mprotect.c