Skip to content

Commit e06f1e1

Browse files
shligittorvalds
authored andcommitted
userfaultfd: wp: enabled write protection in userfaultfd API
Now it's safe to enable write protection in userfaultfd API Signed-off-by: Shaohua Li <[email protected]> Signed-off-by: Andrea Arcangeli <[email protected]> Signed-off-by: Peter Xu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Jerome Glisse <[email protected]> Reviewed-by: Mike Rapoport <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Bobby Powers <[email protected]> Cc: Brian Geffon <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Denis Plotnikov <[email protected]> Cc: "Dr . David Alan Gilbert" <[email protected]> Cc: Martin Cracauer <[email protected]> Cc: Marty McFadden <[email protected]> Cc: Maya Gokhale <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Pavel Emelyanov <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 63b2d41 commit e06f1e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/uapi/linux/userfaultfd.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* means the userland is reading).
2020
*/
2121
#define UFFD_API ((__u64)0xAA)
22-
#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \
22+
#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | \
23+
UFFD_FEATURE_EVENT_FORK | \
2324
UFFD_FEATURE_EVENT_REMAP | \
2425
UFFD_FEATURE_EVENT_REMOVE | \
2526
UFFD_FEATURE_EVENT_UNMAP | \
@@ -34,7 +35,8 @@
3435
#define UFFD_API_RANGE_IOCTLS \
3536
((__u64)1 << _UFFDIO_WAKE | \
3637
(__u64)1 << _UFFDIO_COPY | \
37-
(__u64)1 << _UFFDIO_ZEROPAGE)
38+
(__u64)1 << _UFFDIO_ZEROPAGE | \
39+
(__u64)1 << _UFFDIO_WRITEPROTECT)
3840
#define UFFD_API_RANGE_IOCTLS_BASIC \
3941
((__u64)1 << _UFFDIO_WAKE | \
4042
(__u64)1 << _UFFDIO_COPY)

0 commit comments

Comments
 (0)