]> Git Repo - linux.git/commit - fs/userfaultfd.c
mm/userfaultfd: fail uffd-wp registration if not supported
authorPeter Xu <[email protected]>
Thu, 1 Jul 2021 01:49:06 +0000 (18:49 -0700)
committerLinus Torvalds <[email protected]>
Thu, 1 Jul 2021 03:47:27 +0000 (20:47 -0700)
commit00b151f21f390f1e0b294720a3660506abaf49cd
treee66aa23dd80c0e249d7646b1626dc7d5e0e46bc1
parent8f34f1eac3820fc2722e5159acceb22545b30b0d
mm/userfaultfd: fail uffd-wp registration if not supported

We should fail uffd-wp registration immediately if the arch does not even
have CONFIG_HAVE_ARCH_USERFAULTFD_WP defined.  That'll block also relevant
ioctls on e.g.  UFFDIO_WRITEPROTECT because that'll check against
VM_UFFD_WP, which can only be applied with a success registration.

Remove the WP feature bit too for those archs when handling UFFDIO_API
ioctl.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Peter Xu <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Axel Rasmussen <[email protected]>
Cc: Brian Geffon <[email protected]>
Cc: "Dr . David Alan Gilbert" <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Jerome Glisse <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Lokesh Gidra <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Mina Almasry <[email protected]>
Cc: Oliver Upton <[email protected]>
Cc: Shaohua Li <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Wang Qing <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/userfaultfd.c
This page took 0.049895 seconds and 4 git commands to generate.